-
Notifications
You must be signed in to change notification settings - Fork 884
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix the mistake of changing unwanted file
Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com>
- Loading branch information
Showing
32 changed files
with
261 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Proper Formatting on bash files | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
format_bash_files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install ShellCheck | ||
run: sudo apt install -y shellcheck | ||
|
||
- name: Bash Formatting Guidelines | ||
run: | | ||
echo "### Bash Files Formatting Guidelines ### | ||
If there are errors and warnings regarding your bash files, | ||
You can check that error code definitions in https://www.shellcheck.net/wiki/ site. | ||
You can correct them using the https://www.shellcheck.net/ site. | ||
You have to ignore disable errors in .shellcheckrc file. | ||
" | ||
- name: Fetch master branch | ||
run: git fetch origin master | ||
|
||
- name: Set up changed files | ||
run: | | ||
git diff --name-only origin/master...HEAD | grep -E '^.*\.sh$' | grep -v '^apps/' > changed_files_in_PR.txt || true | ||
- name: Display changed files | ||
run: cat changed_files_in_PR.txt | ||
|
||
- name: Run ShellCheck on changed files | ||
run: | | ||
cat changed_files_in_PR.txt | xargs -I {} shellcheck {} | ||
shell: bash | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Proper Formatting on Python files | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
format_python_files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Python Files Formatting Guidelines | ||
run: | | ||
echo "### Python Files Formatting Guidelines ### | ||
If there is a formatting errors in your python files, | ||
1. First install black | ||
It requires Python 3.8+ to run. | ||
Install with "pip install black" and if you use pipx, install Black with "pipx install black" | ||
If you want to format Jupyter Notebooks, install with pip install "black[jupyter]" | ||
2. Run the command | ||
"python -m black {source_file_or_directory}" or | ||
"black {source_file_or_directory}" | ||
to format python files. | ||
" | ||
- uses: psf/black@stable | ||
with: | ||
src: | | ||
./common | ||
./example | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Proper Formatting on YAML files | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
format_YAML_files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install yamllint | ||
run: pip install yamllint | ||
|
||
- name: YAML Formatting Guidelines | ||
run: | | ||
echo "### YAML Formatting Guidelines ### | ||
If there is a formatting error in your YAML file, you will see errors like the one below: | ||
'Error: 6:4 [indentation] wrong indentation: expected 2 but found 3' | ||
To fix these errors, refer to the YAML formatting rules at: | ||
https://yamllint.readthedocs.io/en/stable/rules.html# | ||
Search for the keyword inside the brackets [] in the error message. In this example, it's 'indentation'. | ||
Note: Some rules have been customized in the '.yamllint.yaml' file. Below is the content of that file: | ||
extends: default | ||
rules: | ||
document-start: | ||
present: false | ||
document-end: | ||
present: false | ||
indentation: | ||
indent-sequences: false | ||
line-length: | ||
max: 400 | ||
" | ||
- name: Fetch master branch | ||
run: git fetch origin master | ||
|
||
- name: Set up changed files | ||
run: | | ||
git diff --name-only origin/master...HEAD | grep -E '^common/.*\.ya?ml$|^example/.*\.ya?ml$' > changed_files_in_PR.txt || true | ||
- name: Display changed files | ||
run: cat changed_files_in_PR.txt | ||
|
||
- name: Run yamllint on changed files | ||
run: | | ||
chmod +x ./run_yamllint.sh | ||
./run_yamllint.sh | ||
shell: bash | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.