-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Replace black and flake8 with Ruff - Setup ruff, ran ruff scans and format - Fixed all present issues - Updated workflow to use ruff instead * chore: Setup pre-commit with ruff hooks * chore: Fix failing tests and moved conftest * chore: modified conftest to aquire token if it is not present
- Loading branch information
1 parent
a1d49be
commit d6cee36
Showing
14 changed files
with
149 additions
and
115 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 |
---|---|---|
@@ -1,40 +1,28 @@ | ||
name: linting | ||
name: Check formatting and linting | ||
|
||
on: | ||
pull_request: | ||
push: { branches: [main] } | ||
|
||
jobs: | ||
black: | ||
ruff-check: | ||
name: Run ruff lint and format checks | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: psf/black@stable | ||
with: | ||
options: "--check --verbose --line-length 79" | ||
src: "./src/sumo/wrapper" | ||
flake8: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
- name: Analysing the code with flake8 | ||
run: | | ||
flake8 src/sumo/wrapper --config .flake8 | ||
python-version: '3.11' | ||
cache: 'pip' | ||
|
||
- name: Installing dependencies | ||
run: pip install ruff | ||
|
||
- name: Run ruff lint | ||
run: ruff check . | ||
|
||
- name: Run ruff format | ||
run: ruff format . --check | ||
|
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 |
---|---|---|
|
@@ -12,4 +12,5 @@ build | |
/src/testing.py | ||
/docs/_build | ||
/src/sumo/wrapper/version.py | ||
*_version.py | ||
*_version.py | ||
.vscode/ |
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,16 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: lint | ||
name: Ruff Lint | ||
description: Linting using ruff | ||
entry: bash -c 'ruff check .' | ||
language: system | ||
stages: ["pre-commit", "pre-push"] | ||
|
||
- id: format | ||
name: Ruff Format | ||
description: Formatting using ruff | ||
entry: bash -c 'ruff format . --check' | ||
language: system | ||
stages: ["pre-commit", "pre-push"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import tenacity as tn | ||
import httpx | ||
import tenacity as tn | ||
|
||
|
||
def _log_retry_info(retry_state): | ||
|
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.