mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 12:45:00 +00:00
Refactored linter to include additional flake8 command for linting.
This commit is contained in:
parent
65495a60a9
commit
b0821bb705
1 changed files with 9 additions and 6 deletions
|
@ -17,14 +17,10 @@ class Linter:
|
||||||
self.encoding = encoding
|
self.encoding = encoding
|
||||||
self.root = root
|
self.root = root
|
||||||
|
|
||||||
fatal = "E9,F821,F823,F831,F406,F407,F701,F702,F704,F706"
|
|
||||||
py_cmd = f"flake8 --select={fatal} --show-source" # noqa: F841
|
|
||||||
|
|
||||||
self.languages = dict(
|
self.languages = dict(
|
||||||
#python=self.py_lint,
|
python=self.py_lint,
|
||||||
#python="/Users/gauthier/Projects/aider/tmp.sh",
|
#python="/Users/gauthier/Projects/aider/tmp.sh",
|
||||||
#python="flake8 --show-source",
|
#python="flake8 --show-source",
|
||||||
python=py_cmd,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def set_linter(self, lang, cmd):
|
def set_linter(self, lang, cmd):
|
||||||
|
@ -85,7 +81,14 @@ class Linter:
|
||||||
if res:
|
if res:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
return lint_python_compile(fname, code)
|
res = lint_python_compile(fname, code)
|
||||||
|
if res:
|
||||||
|
return res
|
||||||
|
|
||||||
|
fatal = "E9,F821,F823,F831,F406,F407,F701,F702,F704,F706"
|
||||||
|
flake8 = f"flake8a --select={fatal} --show-source"
|
||||||
|
|
||||||
|
return self.run_cmd(flake8, rel_fname, code)
|
||||||
|
|
||||||
|
|
||||||
def lint_python_compile(fname, code):
|
def lint_python_compile(fname, code):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue