ci: add strict config for flake8

This commit is contained in:
Ankush Menat 2021-09-01 15:52:16 +05:30
parent 0afff86da7
commit 65279c2471
No known key found for this signature in database
GPG Key ID: 8EA82E09BBD13AAF
3 changed files with 86 additions and 7 deletions

72
.github/helper/.flake8_strict vendored Normal file
View File

@ -0,0 +1,72 @@
[flake8]
ignore =
B007,
B950,
E101,
E111,
E114,
E116,
E117,
E121,
E122,
E123,
E124,
E125,
E126,
E127,
E128,
E131,
E201,
E202,
E203,
E211,
E221,
E222,
E223,
E224,
E225,
E226,
E228,
E231,
E241,
E242,
E251,
E261,
E262,
E265,
E266,
E271,
E272,
E273,
E274,
E301,
E302,
E303,
E305,
E306,
E401,
E402,
E501,
E502,
E701,
E702,
E703,
E741,
F401,
F403,
W191,
W291,
W292,
W293,
W391,
W503,
W504,
E711,
E129,
F841,
E713,
E712,
max-line-length = 200
exclude=.github/helper/semgrep_rules,test_*.py

View File

@ -1,11 +1,12 @@
name: Semgrep name: Linters
on: on:
pull_request: { } pull_request: { }
jobs: jobs:
semgrep:
name: Frappe Linter linters:
name: linters
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -16,3 +17,11 @@ jobs:
config: >- config: >-
r/python.lang.correctness r/python.lang.correctness
.github/helper/semgrep_rules .github/helper/semgrep_rules
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install and Run Pre-commit
uses: pre-commit/action@v2.0.0

View File

@ -9,9 +9,7 @@ repos:
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
files: "erpnext.*" files: "erpnext.*"
- id: end-of-file-fixer exclude: ".*json$|.*txt$|.*csv|.*md"
files: "erpnext.*"
exclude: ".*json$|.*txt$"
- id: check-yaml - id: check-yaml
- id: no-commit-to-branch - id: no-commit-to-branch
args: ['--branch', 'develop'] args: ['--branch', 'develop']
@ -22,7 +20,7 @@ repos:
rev: 3.9.2 rev: 3.9.2
hooks: hooks:
- id: flake8 - id: flake8
additional_dependencies: [flake8-isort] args: ['--config', '.github/helper/.flake8_strict']
exclude: ".*setup.py$" exclude: ".*setup.py$"
ci: ci: