ci: add strict config for flake8
diff --git a/.github/helper/.flake8_strict b/.github/helper/.flake8_strict
new file mode 100644
index 0000000..c17871d
--- /dev/null
+++ b/.github/helper/.flake8_strict
@@ -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
diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
new file mode 100644
index 0000000..c236339
--- /dev/null
+++ b/.github/workflows/linters.yml
@@ -0,0 +1,27 @@
+name: Linters
+
+on:
+ pull_request: { }
+
+jobs:
+
+ linters:
+ name: linters
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: returntocorp/semgrep-action@v1
+ env:
+ SEMGREP_TIMEOUT: 120
+ with:
+ config: >-
+ r/python.lang.correctness
+ .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
diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml
deleted file mode 100644
index e27b406..0000000
--- a/.github/workflows/semgrep.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: Semgrep
-
-on:
- pull_request: { }
-
-jobs:
- semgrep:
- name: Frappe Linter
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: returntocorp/semgrep-action@v1
- env:
- SEMGREP_TIMEOUT: 120
- with:
- config: >-
- r/python.lang.correctness
- .github/helper/semgrep_rules
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0721d43..df15b68 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -9,9 +9,7 @@
hooks:
- id: trailing-whitespace
files: "erpnext.*"
- - id: end-of-file-fixer
- files: "erpnext.*"
- exclude: ".*json$|.*txt$"
+ exclude: ".*json$|.*txt$|.*csv|.*md"
- id: check-yaml
- id: no-commit-to-branch
args: ['--branch', 'develop']
@@ -22,7 +20,7 @@
rev: 3.9.2
hooks:
- id: flake8
- additional_dependencies: [flake8-isort]
+ args: ['--config', '.github/helper/.flake8_strict']
exclude: ".*setup.py$"
ci: