Skip to content

Commit

Permalink
Merge pull request #37 from seapagan/migrate-to-ruff-linter-and-forma…
Browse files Browse the repository at this point in the history
…tter

Migrate to ruff linter and formatter
  • Loading branch information
seapagan authored Oct 28, 2023
2 parents 3fcac01 + 7755814 commit 3f6aec9
Show file tree
Hide file tree
Showing 11 changed files with 179 additions and 1,031 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Linting
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
47 changes: 10 additions & 37 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,30 @@ ci:
autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit.com hooks [dependabot skip]"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
args: [--unsafe]
- id: trailing-whitespace
- id: check-toml
- id: check-merge-conflict
- id: end-of-file-fixer
- repo: https://github.com/psf/black
rev: 23.9.1

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.2
hooks:
- id: black
args: [--line-length=80]
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [--max-line-length=80, --color=auto]
additional_dependencies:
[
flake8-pydocstyle,
flake8-pyproject,
flake8-pytest-style,
flake8-type-checking,
flake8-use-pathlib,
]
# files: ^my_appname/|^test_suite_name/
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: [--profile=black, --line-length=80]
- id: ruff
- id: ruff-format

- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.13.4
hooks:
- id: pymarkdown
exclude: ^.github/|CHANGELOG.md|template/.github/
exclude: ^.github/|CHANGELOG
args: [-d, "MD046", scan]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: ["--silent", "-c", "pyproject.toml", "-r"]
additional_dependencies: ["bandit[toml]"]
- repo: https://github.com/guilatrova/tryceratops
rev: v2.3.2
hooks:
- id: tryceratops
args: ["--ignore", "TRY003"]

- repo: https://github.com/python-poetry/poetry
rev: "1.6.0"
rev: "1.6.1"
hooks:
- id: poetry-check
# - id: poetry-lock
Expand Down
16 changes: 4 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
"source.fixAll": "always",
"source.organizeImports": "always"
},
"editor.defaultFormatter": "ms-python.black-formatter"
"editor.defaultFormatter": "charliermarsh.ruff"
},
"autoDocstring.startOnNewLine": true,
"beautify.language": {
"html": ["htm", "html", "django-html"]
},
"black-formatter.args": ["--line-length=80"],
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"emmet.includeLanguages": {
Expand All @@ -29,21 +28,15 @@
"files.exclude": {
"**/__pycache__": true
},
"flake8.args": ["--max-line-length=80"],
"git.alwaysSignOff": true,
"git.enableCommitSigning": true,
"html.format.indentHandlebars": true,
"html.format.templating": true,
"isort.args": ["--profile", "black", "--src=${workspaceFolder}"],
"material-icon-theme.languages.associations": {
"jinja-html": "django"
},
"pylint.args": [
"--enable=pylint.extensions.docparams",
"--load-plugins",
"pylint-pydantic",
"pylint-pytest"
],
"mypy-type-checker.args": ["--strict"],
"mypy-type-checker.importStrategy": "fromEnvironment",
"python.analysis.autoImportCompletions": true,
"python.analysis.autoImportUserSymbols": true,
"python.analysis.extraPaths": [],
Expand All @@ -55,7 +48,6 @@
"python.testing.pytestArgs": ["tests"],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"ruff.organizeImports": false,
"ruff.fixAll": false,
"mypy-type-checker.args": ["--strict"]
"ruff.organizeImports": true
}
Loading

0 comments on commit 3f6aec9

Please sign in to comment.