These are chat archives for coala/coala-bears

22nd
Apr 2017
Satwik Kansal
@satwikkansal
Apr 22 2017 06:07
@jayvdb Addressed your suggestions in the gdoc, please look through them
Shreyans
@shreyans800755
Apr 22 2017 10:37
@Techievena Thanks, that's quite usefule
Shreyans
@shreyans800755
Apr 22 2017 11:19

While writing new bear, I've added a bear file at coala-bears/bears/general/CLOCBear.py. And I'm trying to run the following command:
coala -d ./bears/general --bears CLOCBear --files=bears/general/CLOCBear.py

And getting the following output:
[WARNING][16:43:59] Implicit 'Default' section inheritance is deprecated. It will be removed soon. To silence this warning remove settings in the 'Default' section from your coafile. You can use dots to specify inheritance: the section 'all.python' will inherit all settings from 'all'. Executing section python... Executing section flakes... Executing section autopep8... Executing section linelength... Executing section CI... Executing section commit... [nltk_data] Downloading package punkt to /home/thereal/nltk_data... [nltk_data] Package punkt is already up-to-date! [nltk_data] Downloading package maxent_treebank_pos_tagger to [nltk_data] /home/thereal/nltk_data... [nltk_data] Package maxent_treebank_pos_tagger is already up-to- [nltk_data] date! [nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] /home/thereal/nltk_data... [nltk_data] Package averaged_perceptron_tagger is already up-to- [nltk_data] date! Executing section rst...

Then it doesn't make any progress. At last, I have to interrupt it to stop.
Am I missing something ?

Yash Nisar
@yash-nisar
Apr 22 2017 11:41
Are you trying to run the bear on a file ?
Shreyans
@shreyans800755
Apr 22 2017 11:42
Yes, on the same file CLOCBear.py itself.
Yash Nisar
@yash-nisar
Apr 22 2017 11:43
You can use -V for a verbose output
Can you try putting the = after the --bears
Yash Nisar
@yash-nisar
Apr 22 2017 11:49
or run coala -b CLOCBear -f /path/to/the/file.py --flush-cache after installing it
Have you done pip3 install -e . from the bears directory ?
Shreyans
@shreyans800755
Apr 22 2017 11:56

Yes, I've installed it. Why is it trying to run other bears although I've specified one and it is also able to find it ? Here are last few lines of output with verbose mode:
[DEBUG][17:23:41] Running bear CLOCBear...
[DEBUG][17:23:41] Running 'cloc / h o m e / t h e r e a l / g i t / c o a l a / c o a l a - b e a r s / R E L E A S E _ N O T E S . r s t'
[DEBUG][17:23:41] Running bear CLOCBear...
[DEBUG][17:23:41] Running 'cloc / h o m e / t h e r e a l / g i t / c o a l a / c o a l a - b e a r s / R E A D M E . r s t'
[DEBUG][17:23:41] Running bear CLOCBear...
[DEBUG][17:23:41] Running 'cloc / h o m e / t h e r e a l / g i t / c o a l a / c o a l a - b e a r s / d o c s / i n d e x . r s t'

Here it is running cloc command on files that I've not mentioned in option f and also putting spaces in file path.

Yash Nisar
@yash-nisar
Apr 22 2017 11:59
Which command did you run ?
Shreyans
@shreyans800755
Apr 22 2017 12:00
Ah! got the problem. It is putting space all over the path after each character. That is causing cloc to consider each character as different file and first is root. So, it is taking time to give output.
But don't know how this spaces are coming in path and also where is this path coming from ?
Command: coala -b CLOCBear -f ./bears/general/CLOCBear.py --flush-cache -V
Yash Nisar
@yash-nisar
Apr 22 2017 12:01
-V should be before -b
Can you paste the output of this command coala -V -b CLOCBear -f ./bears/general/CLOCBear.py --flush-cache ?
Shreyans
@shreyans800755
Apr 22 2017 12:03
Here it is:
Pasting in chunks:
[WARNING][17:32:35] Implicit 'Default' section inheritance is deprecated. It will be removed soon. To silence this warning remove settings in the 'Default' section from your coafile. You can use dots to specify inheritance: the section 'all.python' will inherit all settings from 'all'. [DEBUG][17:32:36] Platform Linux -- Python 3.4.3, coalib 0.11.0.dev99999999999999 [DEBUG][17:32:36] The file cache was successfully flushed. Executing section python... [DEBUG][17:32:36] Files that will be checked: /home/thereal/git/coala/coala-bears/bears/general/CLOCBear.py [DEBUG][17:32:36] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the--flush-cacheflag to see them. [DEBUG][17:32:36] LanguageDefinition has been deprecated! Usecoalib.bearlib.languages.Languageinstead. [DEBUG][17:32:36] Running bear SpaceConsistencyBear... [DEBUG][17:32:36] Running bear AnnotationBear... [DEBUG][17:32:36] Running bear QuotesBear... Executing section flakes... [DEBUG][17:32:36] Files that will be checked: /home/thereal/git/coala/coala-bears/bears/general/CLOCBear.py [DEBUG][17:32:36] starting parse of '/home/thereal/.virtualenvs/myenv/bin/python3 -m pip show autoflake' [DEBUG][17:32:36] returning CommandNode(command=['/home/thereal/.virtualenvs/myenv/bin/python3'] redirects={}) [DEBUG][17:32:36] returning CommandNode(command=['-m'] redirects={}) [DEBUG][17:32:36] returning CommandNode(command=['pip'] redirects={}) [DEBUG][17:32:36] returning CommandNode(command=['show'] redirects={}) [DEBUG][17:32:36] returning CommandNode(command=['autoflake'] redirects={}) [DEBUG][17:32:36] returning CommandNode(command=['/home/thereal/.virtualenvs/myenv/bin/python3', '-m', 'pip', 'show', 'autoflake'] redirects={}) [DEBUG][17:32:36] returning CommandNode(command=['/home/thereal/.virtualenvs/myenv/bin/python3', '-m', 'pip', 'show', 'autoflake'] redirects={}) [DEBUG][17:32:36] returning CommandNode(command=['/home/thereal/.virtualenvs/myenv/bin/python3', '-m', 'pip', 'show', 'autoflake'] redirects={}) [DEBUG][17:32:36] returning CommandNode(command=['/home/thereal/.virtualenvs/myenv/bin/python3', '-m', 'pip', 'show', 'autoflake'] redirects={}) [DEBUG][17:32:36] started: CommandNode(command=['/home/thereal/.virtualenvs/myenv/bin/python3', '-m', 'pip', 'show', 'autoflake'] redirects={}), None, False [DEBUG][17:32:36] Command('/home/thereal/.virtualenvs/myenv/bin/python3 -m pip show autoflake') created [DEBUG][17:32:36] About to call Popen: ['/home/thereal/.virtualenvs/myenv/bin/python3', '-m', 'pip', 'show', 'autoflake'], {'stderr': -1, 'stdin': None, 'stdout': -1} [DEBUG][17:32:36] Popen: Command('/home/thereal/.virtualenvs/myenv/bin/python3 -m pip show autoflake'), {'stderr': -1, 'stdin': None, 'stdout': -1} -> {'returncode': None, 'stdin': None, '_communication_started': False, 'stdout': <_io.BufferedReader name=16>, 'args': ['/home/thereal/.virtualenvs/myenv/bin/python3', '-m', 'pip', 'show', 'autoflake'], '_waitpid_lock': <_thread.lock object at 0x7fcbc89024e0>, '_child_created': True, 'pid': 26408, 'stderr': <_io.BufferedReader name=19>, '_closed_child_pipe_fds': True, '_input': None, 'universal_newlines': False} [DEBUG][17:32:36] Created thread Thread-2 as reader for Capture-1 [DEBUG][17:32:36] Capture-1: reader thread about to read line [DEBUG][17:32:36] Capture-1: reader thread kicked off, waiting start [DEBUG][17:32:36] Capture-1: reader thread now started [DEBUG][17:32:36] Created thread Thread-3 as reader for Capture-2 [DEBUG][17:32:36] Capture-2: reader thread about to read line [DEBUG][17:32:36] Capture-2: reader thread kicked off, waiting start [DEBUG][17:32:36] Capture-2: reader thread now started [DEBUG][17:32:36] about to wait for process [DEBUG][17:32:37] queued chunk of length 16: b'Name: autoflake\n' [DEBUG][17:32:37] queued chunk of length 15: b'Version: 0.6.6\n' [DEBUG][17:32:37] queued chunk of length 54: b'Summary: Removes unused import' [DEBUG][17:32:37] queued chunk of length 46: b'Home-page: https://github.com/'
[DEBUG][17:32:37] queued chunk of length 22: b'Author: Hideo Hattori\n' [DEBUG][17:32:37] queued chunk of length 34: b'Author-email: hhatto.jp@gmail.' [DEBUG][17:32:37] queued chunk of length 23: b'License: Expat License\n' [DEBUG][17:32:37] queued chunk of length 71: b'Location: /home/thereal/.virtu' [DEBUG][17:32:37] queued chunk of length 22: b'Requires: pycodestyle\n' [DEBUG][17:32:38] Capture-4: finished reading stream <_io.BufferedReader name=20> [DEBUG][17:32:38] Capture-3: finished reading stream <_io.BufferedReader name=18> [DEBUG][17:32:38] returning Command('/home/thereal/.virtualenvs/myenv/bin/python3 -m pip show autopep8') (Popen(returncode=0 stdin=None stdout=<_io.BufferedReader name=18> stderr=<_io.BufferedReader name=20>)) [DEBUG][17:32:38] pipeline closing [DEBUG][17:32:38] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the--flush-cacheflag to see them. [DEBUG][17:32:38] Running bear PEP8Bear... [DEBUG][17:32:38] Running bear PycodestyleBear... [DEBUG][17:32:38] Running 'pycodestyle --format=%(row)d %(col)d %(code)s %(text)s --max-line-length=79 /home/thereal/git/coala/coala-bears/bears/general/CLOCBear.py' Executing section linelength... [DEBUG][17:32:38] Files that will be checked: /home/thereal/git/coala/coala-bears/bears/general/CLOCBear.py [DEBUG][17:32:38] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the--flush-cacheflag to see them. [DEBUG][17:32:38] Running bear LineLengthBear... Executing section CI... [DEBUG][17:32:39] Files that will be checked: /home/thereal/git/coala/coala-bears/.ci/deploy.pypi.sh /home/thereal/git/coala/coala-bears/.ci/rultor_secrets.sh.asc /home/thereal/git/coala/coala-bears/.ci/appveyor.yml /home/thereal/git/coala/coala-bears/.ci/deps.sh /home/thereal/git/coala/coala-bears/.ci/adjust_version_number.py /home/thereal/git/coala/coala-bears/.ci/package.json.jinja2 /home/thereal/git/coala/coala-bears/.ci/generate_bear_requirements.py /home/thereal/git/coala/coala-bears/.ci/env_variables.sh /home/thereal/git/coala/coala-bears/.ci/deps.coala-bears.sh /home/thereal/git/coala/coala-bears/.ci/deploy.coverage.sh /home/thereal/git/coala/coala-bears/.ci/deps.cabal.sh /home/thereal/git/coala/coala-bears/.ci/tests.sh /home/thereal/git/coala/coala-bears/.ci/run_with_env.cmd /home/thereal/git/coala/coala-bears/.ci/Gemfile.jinja2 [DEBUG][17:32:39] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the--flush-cacheflag to see them. [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... [DEBUG][17:32:39] Running bear SpaceConsistencyBear... Executing section commit... [DEBUG][17:32:39] Files that will be checked: /home/thereal/git/coala/coala-bears/bears/general/CLOCBear.py [nltk_data] Downloading package punkt to /home/thereal/nltk_data... [nltk_data] Package punkt is already up-to-date! [nltk_data] Downloading package maxent_treebank_pos_tagger to [nltk_data] /home/thereal/nltk_data... [nltk_data] Package maxent_treebank_pos_tagger is already up-to- [nltk_data] date! [nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] /home/thereal/nltk_data... [nltk_data] Package averaged_perceptron_tagger is already up-to- [nltk_data] date!
[nltk_data] /home/thereal/nltk_data... [nltk_data] Package averaged_perceptron_tagger is already up-to- [nltk_data] date! [DEBUG][17:32:40] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the--flush-cacheflag to see them. [DEBUG][17:32:40] Running bear GitCommitBear... Executing section rst... [DEBUG][17:32:41] Files that will be checked: /home/thereal/git/coala/coala-bears/RELEASE_NOTES.rst /home/thereal/git/coala/coala-bears/docs/index.rst /home/thereal/git/coala/coala-bears/README.rst [DEBUG][17:32:41] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the--flush-cacheflag to see them. [DEBUG][17:32:41] Running bear CLOCBear... [DEBUG][17:32:41] Running 'cloc / h o m e / t h e r e a l / g i t / c o a l a / c o a l a - b e a r s / R E L E A S E _ N O T E S . r s t' [DEBUG][17:32:41] Running bear CLOCBear... [DEBUG][17:32:41] Running 'cloc / h o m e / t h e r e a l / g i t / c o a l a / c o a l a - b e a r s / d o c s / i n d e x . r s t' [DEBUG][17:32:41] Running bear CLOCBear... [DEBUG][17:32:41] Running 'cloc / h o m e / t h e r e a l / g i t / c o a l a / c o a l a - b e a r s / R E A D M E . r s t' ^CProgram terminated by user.
Yash Nisar
@yash-nisar
Apr 22 2017 12:05
We generally use the ubuntu pastebin because this clutters the window
paste.ubuntu.com
Can you initiate a PR and I shall have a look at the bear there
or Try running it on some other file and not the bear itself
May I'll just try to run it on some other file.
Shreyans
@shreyans800755
Apr 22 2017 12:18
It is trying to run other bears on file even if I change the file path in flag -f.
By any chance, does it have to do anything with the following line in my bear:
LANGUAGES = {'All'}
?
Yash Nisar
@yash-nisar
Apr 22 2017 12:19
No, this is metadata about the bear, only provides information
John Vandenberg
@jayvdb
Apr 22 2017 12:34
Can you initiate a PR and I shall have a look at the bear there
Push to fork, and look at it there. No PR. ;)
the branch on a fork can be deleted afterwards
A PR is more permanent
A paste/gist of the bear module would help too
are you building a GlobalBear?
Meet Mangukiya
@meetmangukiya
Apr 22 2017 12:42
Do we have 107 bears approx. ?
I don't know how trust worthy this is
± % find -ipath './bears/**bear.py' | wc                                                                                                               !2237
    107     107    3539
Meet Mangukiya
@meetmangukiya
Apr 22 2017 12:52
nvm, I should rebase first
Yash Nisar
@yash-nisar
Apr 22 2017 14:03
Shreyans
@shreyans800755
Apr 22 2017 14:37
@jayvdb CLOCBear can work at file as well as project level. Its based on tool cloc
John Vandenberg
@jayvdb
Apr 22 2017 14:41
@yash-nisar , you need to add that non standard repo , and then add the package name to the list of packages to be installed
see zypper commands at top of Dockerfile
Yash Nisar
@yash-nisar
Apr 22 2017 14:47
but I can see that the repo associated with it has already been added IIUC, http://download.opensuse.org/repositories/home:illuusio/openSUSE_Tumbleweed/home:illuusio.repo