Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ruff (GSI-339) #161

Merged
merged 10 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .deprecated_files
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ docs

setup.py
setup.cfg

.pylintrc
.flake8
21 changes: 0 additions & 21 deletions .flake8

This file was deleted.

14 changes: 2 additions & 12 deletions .github/workflows/static_code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,14 @@ jobs:
- uses: pre-commit/[email protected]
env:
SKIP: no-commit-to-branch
- name: ruff
uses: chartboost/ruff-action@v1
- name: black
run: |
black --check .
- name: isort
KerstenBreuer marked this conversation as resolved.
Show resolved Hide resolved
run: |
isort --check --profile black .
- name: mypy
run: |
mypy .
- name: pylint
run: |
pylint "${{ steps.common.outputs.MAIN_SRC_DIR }}"
- name: flake8
run: |
flake8 --config .flake8
- name: bandit
KerstenBreuer marked this conversation as resolved.
Show resolved Hide resolved
run: |
bandit -r "${{ steps.common.outputs.MAIN_SRC_DIR }}"
- name: Check license header and file
run: |
./scripts/license_checker.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
.ruff_cache/
prof/

# Translations
Expand Down
43 changes: 20 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ default_language_version:
minimum_pre_commit_version: 3.0.0

repos:
- repo: local
KerstenBreuer marked this conversation as resolved.
Show resolved Hide resolved
hooks:
- id: update-hook-revs
name: "ensure hooks are up to date"
language: python
additional_dependencies:
- "typer"
fail_fast: true
always_run: true
entry: ./scripts/update_hook_revs.py
files: '\.pre-commit-config.yaml'
args: [--check]
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand Down Expand Up @@ -36,33 +49,17 @@ repos:
- id: debug-statements
- id: debug-statements
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.290
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: [--profile, black]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.0
rev: v1.5.1
hooks:
- id: mypy
args: [--no-warn-unused-ignores]
- repo: https://github.com/PyCQA/pylint
rev: v2.16.4
hooks:
- id: pylint
args: [--disable=E0401]
exclude: tests|.devcontainer
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args: [--config, .flake8]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
exclude: tests|.devcontainer|scripts
Loading