mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
test: add a basic 'test-check-pylint.t'
We add a minimal check using pylint for one case we knows we care about: "mutable default" argument. We'll likely extend this over time to cover other useful checks but this is a good starting point.
This commit is contained in:
parent
2a46795ed1
commit
a51384137e
@ -413,6 +413,12 @@ def has_pyflakes():
|
||||
br"<stdin>:1: 're' imported but unused",
|
||||
True)
|
||||
|
||||
@check("pylint", "Pylint python linter")
|
||||
def has_pylint():
|
||||
return matchoutput("pylint --help",
|
||||
br"Usage: pylint",
|
||||
True)
|
||||
|
||||
@check("pygments", "Pygments source highlighting library")
|
||||
def has_pygments():
|
||||
try:
|
||||
|
15
tests/test-check-pylint.t
Normal file
15
tests/test-check-pylint.t
Normal file
@ -0,0 +1,15 @@
|
||||
#require test-repo pylint hg10
|
||||
|
||||
Run pylint for known rules we care about.
|
||||
-----------------------------------------
|
||||
|
||||
There should be no recorded failures; fix the codebase before introducing a
|
||||
new check.
|
||||
|
||||
Current checks:
|
||||
- W0102: no mutable default argument
|
||||
|
||||
$ touch $TESTTMP/fakerc
|
||||
$ pylint --rcfile=$TESTTMP/fakerc --disable=all \
|
||||
> --enable=W0102 --reports=no \
|
||||
> mercurial hgext hgext3rd
|
Loading…
Reference in New Issue
Block a user