-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README and introduce linting (#1)
- Loading branch information
Showing
7 changed files
with
79 additions
and
8 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,18 @@ | ||
name: Lint Bash Scripts | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
shellcheck: | ||
name: ShellCheck | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install ShellCheck | ||
run: sudo apt install shellcheck | ||
|
||
- name: Run ShellCheck | ||
run: ./lint_bash.sh |
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,23 @@ | ||
name: Lint Python Scripts | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
flake8: | ||
name: Flake8 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install Flake8 | ||
run: pip install flake8 | ||
|
||
- name: Run Flake8 | ||
run: ./lint_python.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""Dummy Python file to test Flake8 integration.""" | ||
|
||
|
||
def main(msg: str) -> None: | ||
"""Entry point of the script.""" | ||
print("This is a dummy script to test Flake8 integration.") | ||
print(f"Printing user message: {msg}") | ||
|
||
|
||
if __name__ == '__main__': | ||
main("Hello!") |
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,3 @@ | ||
#!/bin/bash | ||
|
||
echo "This is a dummy script to test ShellCheck integration." |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# Lint all Bash files | ||
echo "Running ShellCheck on Bash scripts..." | ||
if ! find . -type f -name "*.sh" -exec shellcheck {} +; then | ||
echo "ShellCheck linting failed." | ||
exit 1 | ||
else | ||
echo "ShellCheck linting passed." | ||
fi |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# Lint all Python files | ||
echo "Running Flake8 on Python files..." | ||
if ! flake8 .; then | ||
echo "Flake8 linting failed." | ||
exit 1 | ||
else | ||
echo "Flake8 linting passed." | ||
fi |