@@ -10,141 +10,141 @@ jobs:
1010 format_python_files :
1111 runs-on : ubuntu-latest
1212 steps :
13- - uses : actions/checkout@v5
14-
15- - name : Python Files Formatting Guidelines
16- run : |
17- echo "### Python Files Formatting Guidelines ###
18- If there is a formatting error in your python files,
19- 1. First install black
20- It requires Python 3.8+ to run.
21- Install with 'pip install black' and if you use pipx, install Black with 'pipx install black'.
22- If you want to format Jupyter Notebooks, install with 'pip install black[jupyter]'.
23-
24- 2. Run the command
25- 'python -m black {source_file_or_directory}' or
26- 'black {source_file_or_directory}'
27- to format python files.
28- "
29- - uses : psf/black@stable
30- with :
31- src : |
32- ./backend
13+ - uses : actions/checkout@v5
14+
15+ - name : Python Files Formatting Guidelines
16+ run : |
17+ echo "### Python Files Formatting Guidelines ###
18+ If there is a formatting error in your python files,
19+ 1. First install black
20+ It requires Python 3.8+ to run.
21+ Install with 'pip install black' and if you use pipx, install Black with 'pipx install black'.
22+ If you want to format Jupyter Notebooks, install with 'pip install black[jupyter]'.
23+
24+ 2. Run the command
25+ 'python -m black {source_file_or_directory}' or
26+ 'black {source_file_or_directory}'
27+ to format python files.
28+ "
29+ - uses : psf/black@stable
30+ with :
31+ src : |
32+ ./backend
3333
3434 format_YAML_files :
3535 runs-on : ubuntu-latest
3636 steps :
37- - uses : actions/checkout@v4
38- with :
39- fetch-depth : 0
40-
41- - name : Install yamllint
42- run : pip install yamllint
43-
44- - name : YAML Formatting Guidelines
45- run : |
46- echo "### YAML Formatting Guidelines ###
47- If there is a formatting error in your YAML file, you will see errors like the one below:
48- 'Error: 6:4 [indentation] wrong indentation: expected 2 but found 3'
49-
50- 6:4 means line 6, column 4.
51-
52- To fix these errors, refer to the YAML formatting rules at:
53- https://yamllint.readthedocs.io/en/stable/rules.html#
54-
55- Search for the keyword inside the brackets [] in the error message. In this example, it's 'indentation'.
56- Note: Some rules have been customized in the '.yamllint.yaml' file. Below is the content of that file:
57-
58- extends: default
59-
60- rules:
61- document-start:
62- present: false
63- document-end:
64- present: false
65- indentation:
66- indent-sequences: false
67- line-length:
68- max: 400
69- "
70-
71- - name : Fetch master branch
72- run : git fetch origin master
73-
74- - name : Set up changed files
75- id : changed_files
76- run : |
77- git diff --name-only --diff-filter=AM origin/master...HEAD \
78- | grep -v 'upstream' \
79- | grep -E '^common/.*\.ya?ml$|^example/.*\.ya?ml$|^hack/.*\.ya?ml$|^tests/.*\.ya?ml$|^.github/.*\.ya?ml$' \
80- > changed_files_in_PR.txt || true
81- if [ ! -s changed_files_in_PR.txt ]; then
82- echo "No YAML files have changed in this PR." > changed_files_in_PR.txt
83- fi
84-
85- - name : Display changed files
86- run : cat changed_files_in_PR.txt
87-
88- - name : Run yamllint on changed files
89- id : lint
90- run : |
91- if grep -q 'No YAML files have changed in this PR.' changed_files_in_PR.txt; then
92- echo "No YAML files have changed in this PR."
93- else
94- cat changed_files_in_PR.txt | xargs -I {} yamllint {} || exit 1
95- fi
96- shell : bash
97-
98- - name : Check YAML lint results
99- if : success() && steps.lint.outcome == 'success'
100- run : echo "No styling issues with YAML files."
101- shell : bash
37+ - uses : actions/checkout@v4
38+ with :
39+ fetch-depth : 0
40+
41+ - name : Install yamllint
42+ run : pip install yamllint
43+
44+ - name : YAML Formatting Guidelines
45+ run : |
46+ echo "### YAML Formatting Guidelines ###
47+ If there is a formatting error in your YAML file, you will see errors like the one below:
48+ 'Error: 6:4 [indentation] wrong indentation: expected 2 but found 3'
49+
50+ 6:4 means line 6, column 4.
51+
52+ To fix these errors, refer to the YAML formatting rules at:
53+ https://yamllint.readthedocs.io/en/stable/rules.html#
54+
55+ Search for the keyword inside the brackets [] in the error message. In this example, it's 'indentation'.
56+ Note: Some rules have been customized in the '.yamllint.yaml' file. Below is the content of that file:
57+
58+ extends: default
59+
60+ rules:
61+ document-start:
62+ present: false
63+ document-end:
64+ present: false
65+ indentation:
66+ indent-sequences: false
67+ line-length:
68+ max: 400
69+ "
70+
71+ - name : Fetch master branch
72+ run : git fetch origin master
73+
74+ - name : Set up changed files
75+ id : changed_files
76+ run : |
77+ git diff --name-only --diff-filter=AM origin/master...HEAD \
78+ | grep -v 'upstream' \
79+ | grep -E '^common/.*\.ya?ml$|^example/.*\.ya?ml$|^hack/.*\.ya?ml$|^tests/.*\.ya?ml$|^.github/.*\.ya?ml$|^manifests /.*\.ya?ml$' \
80+ > changed_files_in_PR.txt || true
81+ if [ ! -s changed_files_in_PR.txt ]; then
82+ echo "No YAML files have changed in this PR." > changed_files_in_PR.txt
83+ fi
84+
85+ - name : Display changed files
86+ run : cat changed_files_in_PR.txt
87+
88+ - name : Run yamllint on changed files
89+ id : lint
90+ run : |
91+ if grep -q 'No YAML files have changed in this PR.' changed_files_in_PR.txt; then
92+ echo "No YAML files have changed in this PR."
93+ else
94+ cat changed_files_in_PR.txt | xargs -I {} yamllint {} || exit 1
95+ fi
96+ shell : bash
97+
98+ - name : Check YAML lint results
99+ if : success() && steps.lint.outcome == 'success'
100+ run : echo "No styling issues with YAML files."
101+ shell : bash
102102
103103 format_bash_files :
104104 runs-on : ubuntu-latest
105105 steps :
106- - uses : actions/checkout@v4
107- with :
108- fetch-depth : 0
109-
110- - name : Install ShellCheck
111- run : sudo apt install -y shellcheck
112-
113- - name : Bash Formatting Guidelines
114- run : |
115- echo "### Bash Files Formatting Guidelines ###
116- If there are errors and warnings regarding your bash files,
117- You can check the error code definitions at https://www.shellcheck.net/wiki/.
118- You can correct them using the https://www.shellcheck.net/ site.
119- You have to ignore disable errors in the .shellcheckrc file.
120- "
121-
122- - name : Fetch master branch
123- run : git fetch origin master
124-
125- - name : Set up changed files
126- id : changed_files
127- run : |
128- git diff --name-only origin/master...HEAD | grep -E '^[AM].*\.sh$' | grep -v '^applications/' | awk '{print $2}' > changed_files_in_PR.txt || true
129- if [ ! -s changed_files_in_PR.txt ]; then
130- echo "No bash files have changed in this PR."
131- fi
132-
133- - name : Display changed files
134- if : always() # Always run this step
135- run : cat changed_files_in_PR.txt || echo "No bash files have changed in this PR."
136-
137- - name : Run ShellCheck on changed files
138- id : lint
139- run : |
140- if grep -q 'No bash files have changed in this PR.' changed_files_in_PR.txt; then
141- echo "No bash files have changed in this PR."
142- else
143- cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || exit 1
144- fi
145- shell : bash
146-
147- - name : Check Bash lint results
148- if : success() && steps.lint.outcome == 'success'
149- run : echo "No styling issues with Bash files."
150- shell : bash
106+ - uses : actions/checkout@v4
107+ with :
108+ fetch-depth : 0
109+
110+ - name : Install ShellCheck
111+ run : sudo apt install -y shellcheck
112+
113+ - name : Bash Formatting Guidelines
114+ run : |
115+ echo "### Bash Files Formatting Guidelines ###
116+ If there are errors and warnings regarding your bash files,
117+ You can check the error code definitions at https://www.shellcheck.net/wiki/.
118+ You can correct them using the https://www.shellcheck.net/ site.
119+ You have to ignore disable errors in the .shellcheckrc file.
120+ "
121+
122+ - name : Fetch master branch
123+ run : git fetch origin master
124+
125+ - name : Set up changed files
126+ id : changed_files
127+ run : |
128+ git diff --name-only origin/master...HEAD | grep -E '^[AM].*\.sh$' | grep -v '^applications/' | awk '{print $2}' > changed_files_in_PR.txt || true
129+ if [ ! -s changed_files_in_PR.txt ]; then
130+ echo "No bash files have changed in this PR."
131+ fi
132+
133+ - name : Display changed files
134+ if : always() # Always run this step
135+ run : cat changed_files_in_PR.txt || echo "No bash files have changed in this PR."
136+
137+ - name : Run ShellCheck on changed files
138+ id : lint
139+ run : |
140+ if grep -q 'No bash files have changed in this PR.' changed_files_in_PR.txt; then
141+ echo "No bash files have changed in this PR."
142+ else
143+ cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || exit 1
144+ fi
145+ shell : bash
146+
147+ - name : Check Bash lint results
148+ if : success() && steps.lint.outcome == 'success'
149+ run : echo "No styling issues with Bash files."
150+ shell : bash
0 commit comments