-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #467 from vortexntnu/463-task-address-pylint-linti…
…ng-errors-in-codebase Add pylint configuration, fix linting issues, and update CI pipeline for Python
- Loading branch information
Showing
66 changed files
with
3,033 additions
and
1,477 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 @@ | ||
theses |
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,6 @@ | ||
[codespell] | ||
# File containing words to ignore during the spell check. | ||
ignore-words = .codespellignore | ||
|
||
# Check file names as well. | ||
check-filenames = true |
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
name: Run clang-format Linter | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: DoozyX/[email protected] | ||
with: | ||
source: "." | ||
exclude: "./lib" | ||
extensions: "h,cpp,c" | ||
clangFormatVersion: 18 | ||
inplace: True | ||
- uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Clang Robot | ||
author_email: [email protected] | ||
message: "Committing clang-format changes" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
name: codespell | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
codespell: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Install codespell | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y codespell | ||
- name: Run codespell to fix spelling mistakes | ||
run: | | ||
codespell -w . | ||
- name: Commit codespell changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Codespell Robot | ||
author_email: [email protected] | ||
message: "Committing codespell fixes" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,22 @@ | ||
name: mypy | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
mypy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Install mypy | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y python3-pip | ||
pip3 install mypy | ||
- name: Run mypy type checking | ||
run: | | ||
mypy . --explicit-package-bases |
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,68 @@ | ||
name: Python Format and Lint (isort, black, pylint) | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
isort: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Run isort to sort imports | ||
uses: isort/isort-action@v1 | ||
|
||
- name: Commit isort changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Isort Robot | ||
author_email: [email protected] | ||
message: "Committing isort changes" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
black: | ||
runs-on: ubuntu-latest | ||
needs: isort | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Check files using the black formatter | ||
uses: rickstaa/action-black@v1 | ||
id: action_black | ||
with: | ||
black_args: "." | ||
|
||
- name: Commit black-format changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Black Robot | ||
author_email: [email protected] | ||
message: "Committing black-format changes" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
pylint: | ||
runs-on: ubuntu-latest | ||
needs: black | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pylint | ||
- name: Analysing the code with pylint | ||
run: | | ||
pylint $(git ls-files '*.py') |
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,31 @@ | ||
name: Yaml Format (prettier) | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Install Prettier | ||
run: | | ||
sudo npm install -g prettier | ||
# Run Prettier to format all YAML files | ||
- name: Run Prettier to format YAML files | ||
run: | | ||
prettier --write "**/*.yaml" "**/*.yml" | ||
# Commit Prettier changes | ||
- name: Commit Prettier changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Prettier Robot | ||
author_email: [email protected] | ||
message: "Committing Prettier formatting fixes" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.