blob: c7caa4cbab2a39315c9a329e5564093450365b2f [file] [log] [blame]
Ankush Menat65279c22021-09-01 15:52:16 +05301name: Linters
2
3on:
4 pull_request: { }
5
6jobs:
7
8 linters:
9 name: linters
10 runs-on: ubuntu-latest
11 steps:
Deepesh Garg924cdef2023-07-14 18:53:02 +053012 - uses: actions/checkout@v3
Ankush Menat65279c22021-09-01 15:52:16 +053013
Ankush Menat080fcb92022-06-28 13:46:12 +053014 - name: Set up Python 3.10
Deepesh Garg924cdef2023-07-14 18:53:02 +053015 uses: actions/setup-python@v4
Ankush Menat65279c22021-09-01 15:52:16 +053016 with:
Ankush Menat080fcb92022-06-28 13:46:12 +053017 python-version: '3.10'
Deepesh Garg924cdef2023-07-14 18:53:02 +053018 cache: pip
Ankush Menat65279c22021-09-01 15:52:16 +053019
20 - name: Install and Run Pre-commit
Deepesh Garg924cdef2023-07-14 18:53:02 +053021 uses: pre-commit/action@v3.0.0
Ankush Menat5ada11b2021-10-20 14:53:49 +053022
Ankush Menatef7aefe2024-01-18 11:29:53 +053023 semgrep:
24 name: semgrep
25 runs-on: ubuntu-latest
26 steps:
27 - uses: actions/checkout@v3
28
29 - name: Set up Python 3.10
30 uses: actions/setup-python@v4
31 with:
32 python-version: '3.10'
33 cache: pip
34
Ankush Menatcc1baae2021-10-22 21:43:50 +053035 - name: Download Semgrep rules
Ankush Menat4ad2b852021-10-22 22:38:44 +053036 run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
Ankush Menatcc1baae2021-10-22 21:43:50 +053037
Ankush Menat080fcb92022-06-28 13:46:12 +053038 - name: Download semgrep
Deepesh Garg924cdef2023-07-14 18:53:02 +053039 run: pip install semgrep
Ankush Menat080fcb92022-06-28 13:46:12 +053040
41 - name: Run Semgrep rules
42 run: semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness