Skip to content

Commit 8e04c27

Browse files
KIT-4555 introduce ruff (#14)
* KIT-4555 introduce ruff * Update devcontainer.json * KIT-4555 format all * Remove flake exclude --------- Co-authored-by: aott <ottalexanderdev@gmail.com>
1 parent 0c262a3 commit 8e04c27

25 files changed

+203
-154
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ FROM mcr.microsoft.com/devcontainers/python:3.12-bookworm
33

44
# Uninstall pre-installed formatting and linting tools
55
# They would conflict with our pinned versions
6-
RUN pipx uninstall flake8
6+
RUN pipx uninstall ruff
77
RUN pipx uninstall mypy

.devcontainer/devcontainer.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,16 @@
99
"settings": {
1010
"python.pythonPath": "/usr/local/bin/python",
1111
"python.defaultInterpreterPath": "/usr/local/bin/python",
12-
"python.languageServer": "Pylance",
13-
"flake8.path": [
14-
"/usr/local/py-utils/bin/bandit",
15-
"/usr/local/py-utils/bin/pydocstyle"
16-
],
17-
"flake8.importStrategy": "fromEnvironment"
12+
"python.languageServer": "Pylance"
1813
},
1914
"extensions": [
2015
"AykutSarac.jsoncrack-vscode",
16+
"charliermarsh.ruff",
2117
"eamodio.gitlens",
2218
"geeebe.duplicate",
2319
"Gruntfuggly.todo-tree",
24-
"kaih2o.python-resource-monitor",
2520
"matangover.mypy",
26-
"ms-python.black-formatter",
27-
"ms-python.flake8",
28-
"ms-python.isort",
29-
"ms-python.pylint",
3021
"ms-python.python",
31-
"ms-python.vscode-pylance",
3222
"ms-toolsai.jupyter",
3323
"njpwerner.autodocstring",
3424
"njqdev.vscode-python-typehint",
@@ -38,7 +28,8 @@
3828
"streetsidesoftware.code-spell-checker",
3929
"tamasfe.even-better-toml",
4030
"visualstudioexptteam.vscodeintellicode",
41-
"yzhang.markdown-all-in-one"
31+
"yzhang.markdown-all-in-one",
32+
"kaih2o.python-resource-monitor"
4233
]
4334
}
4435
},
@@ -48,4 +39,4 @@
4839
"mounts": [
4940
"source=${localEnv:USERPROFILE}/_devcontainer/cache,target=/home/vscode/.cache,type=bind"
5041
]
51-
}
42+
}

.flake8

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/flake8-error-problem-matcher.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/flake8-warning-problem-matcher.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ jobs:
2323
python-version: "3.12"
2424
- name: Add linting matchers
2525
run: |
26-
echo "::add-matcher::.github/flake8-error-problem-matcher.json"
27-
echo "::add-matcher::.github/flake8-warning-problem-matcher.json"
2826
echo "::add-matcher::.github/mypy-error-problem-matcher.json"
29-
- name: Lint
30-
uses: py-actions/flake8@v2
3127
- name: Install dependencies
3228
run: |
3329
python -m pip install --upgrade pip
3430
pip install -r requirements-dev.txt
31+
- name: Create ruff failures dir
32+
run: mkdir -p ./ruff_failures
33+
- name: Lint with ruff
34+
run: |
35+
ruff check --output-format github . || echo "sag_py_auth" >> ./ruff_failures/ruff_failures.txt
3536
- name: Lint typing
3637
# Must run with installed dependencies
3738
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.idea/sqlDataSources.xml
1414
.idea/dynamic.xml
1515
.idea/dictionaries
16+
.idea/ruff.xml
1617

1718
## File-based project format
1819
*.ipr

.idea/runConfigurations/Lint.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ exclude = (?x)(
66
venv/
77
| build/
88
| dist/
9+
| /site-packages/
910
)
1011
follow_imports = silent
1112
# Suppresses error messages about imports that cannot be resolved.

.pylintrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)