Hi,
I don't want to reinvent to bicycle (even though it is easy), so is there a support for checking linefeeds in any of the existing linter tools?
The two checks in particular are interesting: 1. test that files don't have mixed linefeeeds 2. test that files comply with project linefeed style (LF in particular)
This is needed for Travis checks, but I also want to run it standalone on Windows, so grep won't work. https://github.com/spyder-ide/spyder/issues/2424
Thanks.
On Wed, Jun 3, 2015 at 1:59 PM, anatoly techtonik techtonik@gmail.com wrote:
Hi,
I don't want to reinvent to bicycle (even though it is easy), so is there a support for checking linefeeds in any of the existing linter tools?
The two checks in particular are interesting:
- test that files don't have mixed linefeeeds
- test that files comply with project linefeed style (LF in particular)
This is needed for Travis checks, but I also want to run it standalone on Windows, so grep won't work. https://github.com/spyder-ide/spyder/issues/2424
Thanks.
anatoly t. _______________________________________________ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality
Try pylint:
$ pylint a.py -rn --expected-line-ending-format=LF C: 1, 0: Unexpected line ending format. There is 'LF' while it should be 'CRLF'. (unexpected-line-ending-format C: 3, 0: Mixed line endings LF and CRLF (mixed-line-endings)
On Thu, Jun 4, 2015 at 4:08 PM, Claudiu Popa pcmanticore@gmail.com wrote:
On Wed, Jun 3, 2015 at 1:59 PM, anatoly techtonik techtonik@gmail.com wrote:
Hi,
I don't want to reinvent to bicycle (even though it is easy), so is there a support for checking linefeeds in any of the existing linter tools?
The two checks in particular are interesting:
- test that files don't have mixed linefeeeds
- test that files comply with project linefeed style (LF in particular)
This is needed for Travis checks, but I also want to run it standalone on Windows, so grep won't work. https://github.com/spyder-ide/spyder/issues/2424
Thanks.
anatoly t. _______________________________________________ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality
Try pylint:
$ pylint a.py -rn --expected-line-ending-format=LF C: 1, 0: Unexpected line ending format. There is 'LF' while it should be 'CRLF'. (unexpected-line-ending-format C: 3, 0: Mixed line endings LF and CRLF (mixed-line-endings)
The actual command was pylint a.py -rn --expected-line-ending-format=CRLF.
That helps, thanks. How to run only this check on app *.py files in repository? I found codenames C0327 (mixed line endings) and C0328 (unexpected feeds)
On Thu, Jun 4, 2015 at 4:09 PM, Claudiu Popa pcmanticore@gmail.com wrote:
On Thu, Jun 4, 2015 at 4:08 PM, Claudiu Popa pcmanticore@gmail.com wrote:
On Wed, Jun 3, 2015 at 1:59 PM, anatoly techtonik techtonik@gmail.com wrote:
Hi,
I don't want to reinvent to bicycle (even though it is easy), so is there a support for checking linefeeds in any of the existing linter tools?
The two checks in particular are interesting:
- test that files don't have mixed linefeeeds
- test that files comply with project linefeed style (LF in particular)
This is needed for Travis checks, but I also want to run it standalone on Windows, so grep won't work. https://github.com/spyder-ide/spyder/issues/2424
Thanks.
anatoly t. _______________________________________________ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality
Try pylint:
$ pylint a.py -rn --expected-line-ending-format=LF C: 1, 0: Unexpected line ending format. There is 'LF' while it should be 'CRLF'. (unexpected-line-ending-format C: 3, 0: Mixed line endings LF and CRLF (mixed-line-endings)
The actual command was pylint a.py -rn --expected-line-ending-format=CRLF.
Found the command: py -2 -m pylint --reports=n --disable=all --enable=trailing-whitespace,mixed-line-endings,unexpected-line-ending-format --expected-line-ending-format=LF file.py
Now how to run that on all modules/packages recursively?
On Thu, Jun 4, 2015 at 9:20 PM, anatoly techtonik techtonik@gmail.com wrote:
That helps, thanks. How to run only this check on app *.py files in repository? I found codenames C0327 (mixed line endings) and C0328 (unexpected feeds)
On Thu, Jun 4, 2015 at 4:09 PM, Claudiu Popa pcmanticore@gmail.com wrote:
On Thu, Jun 4, 2015 at 4:08 PM, Claudiu Popa pcmanticore@gmail.com wrote:
On Wed, Jun 3, 2015 at 1:59 PM, anatoly techtonik techtonik@gmail.com wrote:
Hi,
I don't want to reinvent to bicycle (even though it is easy), so is there a support for checking linefeeds in any of the existing linter tools?
The two checks in particular are interesting:
- test that files don't have mixed linefeeeds
- test that files comply with project linefeed style (LF in particular)
This is needed for Travis checks, but I also want to run it standalone on Windows, so grep won't work. https://github.com/spyder-ide/spyder/issues/2424
Thanks.
anatoly t. _______________________________________________ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality
Try pylint:
$ pylint a.py -rn --expected-line-ending-format=LF C: 1, 0: Unexpected line ending format. There is 'LF' while it should be 'CRLF'. (unexpected-line-ending-format C: 3, 0: Mixed line endings LF and CRLF (mixed-line-endings)
The actual command was pylint a.py -rn --expected-line-ending-format=CRLF.
-- anatoly t.
On Thu, Jun 4, 2015 at 9:30 PM, anatoly techtonik techtonik@gmail.com wrote:
Found the command: py -2 -m pylint --reports=n --disable=all --enable=trailing-whitespace,mixed-line-endings,unexpected-line-ending-format --expected-line-ending-format=LF file.py
Now how to run that on all modules/packages recursively?
You can use `py -2 pylint package`, it will run on all package's modules.
We don't support (yet) something like `py -2 pylint *.py` though.
On Thu, Jun 4, 2015 at 9:42 PM, Claudiu Popa pcmanticore@gmail.com wrote:
On Thu, Jun 4, 2015 at 9:30 PM, anatoly techtonik techtonik@gmail.com wrote:
Found the command: py -2 -m pylint --reports=n --disable=all --enable=trailing-whitespace,mixed-line-endings,unexpected-line-ending-format --expected-line-ending-format=LF file.py
Now how to run that on all modules/packages recursively?
You can use `py -2 pylint package`, it will run on all package's modules.
We don't support (yet) something like `py -2 pylint *.py` though.
Does it support multiple modules like `pylint package1 package1 ...`? Command line help looks like it doesn't.
Also, is it possible to limit CRLF mismatch message to a single line per file if all lines are in the wrong format? https://travis-ci.org/spyder-ide/spyder/jobs/65453904
On Thu, Jun 4, 2015 at 9:47 PM, anatoly techtonik techtonik@gmail.com wrote:
Does it support multiple modules like `pylint package1 package1 ...`? Command line help looks like it doesn't.
Also, is it possible to limit CRLF mismatch message to a single line per file if all lines are in the wrong format? https://travis-ci.org/spyder-ide/spyder/jobs/65453904
-- anatoly t.
Yes, you can give to it multiple packages. If it's not clear from the documentation, maybe it's a bug. Regarding your last question, no..pylint is quite pedantic and it emits the same message for every line that has the given problem.
On Thu, Jun 4, 2015 at 9:58 PM, Claudiu Popa pcmanticore@gmail.com wrote:
On Thu, Jun 4, 2015 at 9:47 PM, anatoly techtonik techtonik@gmail.com wrote:
Does it support multiple modules like `pylint package1 package1 ...`? Command line help looks like it doesn't.
Also, is it possible to limit CRLF mismatch message to a single line per file if all lines are in the wrong format? https://travis-ci.org/spyder-ide/spyder/jobs/65453904
Yes, you can give to it multiple packages. If it's not clear from the documentation, maybe it's a bug.
Not from documentation, but from command line help. At least with pylint 1.4.0
Regarding your last question, no..pylint is quite pedantic and it emits the same message for every line that has the given problem.
On the other hand, that's not a big deal.
Thanks.