-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgen_py_module_python_checker.yml
More file actions
33 lines (33 loc) · 1.1 KB
/
gen_py_module_python_checker.yml
File metadata and controls
33 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: gen_py_module_python_checker
on:
push:
branches: [ master ]
paths:
- 'gen_py_module/**'
- 'tests/**'
- 'setup.py'
pull_request:
branches: [ master ]
paths:
- 'gen_py_module/**'
- 'tests/**'
- 'setup.py'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check max length of lines in modules
id: long_line_checker
run: |
modules_ok=0
modules=($(find gen_py_module/ tests/ -type f -name '*.py' -exec echo '{}' \;))
for mod in "${modules[@]}"; do line_length=$(wc -L < "${mod}"); [[ $line_length -gt 127 ]] && modules_ok=1; done
[[ $modules_ok -eq 0 ]] && echo ok || exit 1
- name: Check max number of lines in modules
id: num_line_checker
run: |
modules_ok=0
modules=($(find gen_py_module/ tests/ -type f -name '*.py' -exec echo '{}' \;))
for mod in "${modules[@]}"; do line_numbers=$(wc -l < "${mod}"); [[ $line_numbers -gt 300 ]] && modules_ok=1; done
[[ $modules_ok -eq 0 ]] && echo ok || exit 1