-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflask_func_struct_python_checker.yml
More file actions
54 lines (54 loc) · 2.75 KB
/
flask_func_struct_python_checker.yml
File metadata and controls
54 lines (54 loc) · 2.75 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: flask_func_struct_python_checker
on:
push:
branches: [ master ]
paths:
- 'app_server/**'
- 'manage_commands/**'
- 'manage.py'
pull_request:
branches: [ master ]
paths:
- 'app_server/**'
- 'manage_commands/**'
- 'manage.py'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check length of line in app_server modules
id: long_line_checker_app_server
run: |
echo Checking length of line in app_server modules
modules_ok=0
modules=($(find app_server/ -type f -name '*.py' -exec echo '{}' \;))
for mod in "${modules[@]}"; do line_length=$(wc -L < "${mod}"); [[ $line_length -gt 80 ]] && modules_ok=1; done
[[ $modules_ok -eq 0 ]] && echo ::set-output name=status::success || echo ::set-output name=status::failure
- name: check length of line in manage_commands modules
id: long_line_checker_manage_commands
run: |
echo Checking length of line in manage_commands modules
modules_ok=0
modules=($(find manage_commands/ -type f -name '*.py' -exec echo '{}' \;))
for mod in "${modules[@]}"; do line_length=$(wc -L < "${mod}"); [[ $line_length -gt 80 ]] && modules_ok=1; done
[[ $modules_ok -eq 0 ]] && echo ::set-output name=status::success || echo ::set-output name=status::failure
- name: check number of lines in app_server modules
id: num_line_checker_app_server
run: |
echo Checking number of lines in app_server modules
modules_ok=0
modules=($(find app_server/ -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 ::set-output name=status::success || echo ::set-output name=status::failure
- name: check number of lines in manage_commands modules
id: num_line_checker_manage_commands
run: |
echo Checking number of lines in manage_commands modules
modules_ok=0
modules=($(find manage_commands/ -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 ::set-output name=status::success || echo ::set-output name=status::failure
- name: check on failures
if: steps.long_line_checker_app_server.outputs.status == 'failure' || steps.long_line_checker_manage_commands.outputs.status == 'failure' || steps.num_line_checker_app_server.outouts.status == 'failure' || steps.num_line_checker_manage_commands.outputs.status == 'failure'
run: exit 1