linter-pylint
linter-pylint copied to clipboard
Clarify description for rcFile
Hi I recently began to get the following error:
Error: Traceback (most recent call last):
File "/usr/local/bin/pylint", line 11, in <module>
sys.exit(run_pylint())
File "/usr/local/lib/python2.7/dist-packages/pylint/__init__.py", line 17, in run_pylint
Run(sys.argv[1:])
File "/usr/local/lib/python2.7/dist-packages/pylint/lint.py", line 1287, in __init__
linter.read_config_file()
File "/usr/local/lib/python2.7/dist-packages/pylint/config.py", line 636, in read_config_file
with io.open(config_file, 'r', encoding='utf_8_sig') as fp:
IOError: [Errno 21] Is a directory: '/home/blackhatmonkey/workspace'
at /home/blackhatmonkey/.atom/packages/linter-pylint/lib/main.js:130:19
I was wondering if you could help me figure out the problem.
Looks like that error is being re-thrown from the output of pylint
. Does pylint
itself work when you run it on the file in question from the CLI?
yes pylint
works from CLI.
Here is the output of pylint
from terminal:
blackhatmonkey@Desktop1:~/workspace/wifiphisher$ pylint --rcfile=pylintrc wifiphisher/
************* Module wifiphisher.phishingpage
I: 1, 0: Ignoring entire file (file-ignored)
************* Module wifiphisher.constants
I: 3, 0: Ignoring entire file (file-ignored)
************* Module wifiphisher.macmatcher
I: 1, 0: Ignoring entire file (file-ignored)
************* Module wifiphisher.interfaces
I: 1, 0: Ignoring entire file (file-ignored)
************* Module wifiphisher.firewall
I: 1, 0: Ignoring entire file (file-ignored)
************* Module wifiphisher.pywifiphisher
I: 3, 0: Ignoring entire file (file-ignored)
************* Module wifiphisher.phishinghttp
I: 1, 0: Ignoring entire file (file-ignored)
Report
======
35 statements analysed.
Statistics by type
------------------
+---------+-------+-----------+-----------+------------+---------+
|type |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module |2 |2 |= |100.00 |0.00 |
+---------+-------+-----------+-----------+------------+---------+
|class |1 |1 |= |100.00 |0.00 |
+---------+-------+-----------+-----------+------------+---------+
|method |7 |7 |= |100.00 |0.00 |
+---------+-------+-----------+-----------+------------+---------+
|function |0 |0 |= |0 |0 |
+---------+-------+-----------+-----------+------------+---------+
External dependencies
---------------------
::
scapy
\-layers
| \-dot11 (wifiphisher.deauth)
\-sendrecv (wifiphisher.deauth)
Raw metrics
-----------
+----------+-------+------+---------+-----------+
|type |number |% |previous |difference |
+==========+=======+======+=========+===========+
|code |47 |29.75 |47 |= |
+----------+-------+------+---------+-----------+
|docstring |77 |48.73 |77 |= |
+----------+-------+------+---------+-----------+
|comment |12 |7.59 |12 |= |
+----------+-------+------+---------+-----------+
|empty |22 |13.92 |22 |= |
+----------+-------+------+---------+-----------+
Duplication
-----------
+-------------------------+------+---------+-----------+
| |now |previous |difference |
+=========================+======+=========+===========+
|nb duplicated lines |0 |0 |= |
+-------------------------+------+---------+-----------+
|percent duplicated lines |0.000 |0.000 |= |
+-------------------------+------+---------+-----------+
Messages by category
--------------------
+-----------+-------+---------+-----------+
|type |number |previous |difference |
+===========+=======+=========+===========+
|convention |0 |0 |= |
+-----------+-------+---------+-----------+
|refactor |0 |0 |= |
+-----------+-------+---------+-----------+
|warning |0 |0 |= |
+-----------+-------+---------+-----------+
|error |0 |0 |= |
+-----------+-------+---------+-----------+
Messages
--------
+-------------+------------+
|message id |occurrences |
+=============+============+
|file-ignored |7 |
+-------------+------------+
Global evaluation
-----------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
@Arcanemagus I was able to narrow this problem down to using the Rc File
field. Using either %p
or %f
will cause this problem. Not specifying anything works as expected.
@blackHatMonkey This should be fixed in the upcoming v2.0.0 release, if not please let me know!
@Arcanemagus Thanks for you hard work :smile: :+1: .
I do still get the error after upgrading to the latest version. I also included a log from the console
so it might help you:
error.txt
What do you have in the rcFile
setting?
I meant in the setting in Atom 😉.
Both %p
and %f
seem to cause the error.
Ah ha! You are just putting the directory in there. pylint
should already be finding the default file for you, that setting is for is you are using a custom directory that pylint
normally wouldn't find, or even using a custom name. As such if you are using that setting you need the full path to the file you are trying to use, including the file name.
@Arcanemagus Thanks for all your work. Perhaps the wording can be changed to remove any ambiguity :smile:.
Sounds like a decent enough request to me, do you have anything better in mind?
Maybe an example would show users how to properly use it.
I had a stab at it, and I am not sure how to do it properly.
The documentation already clearly says "Path to the pylintrc file.", it does not say something like "Directory containing the pylintrc file."
An example could just be confusing… The default working directory is the project root, so a sane example would just look like "my-pylintrc" without any path, which could be confusing. A really weird example like "/home/jdoe/my-pylintrc" could be even more confusing, and I would argue you should know if you are in this kind of situation.