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

refactor: static analysis #207

Merged
merged 11 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# See https://help.github.com/articles/about-code-owners/

# Code
/onnx2torch @ivkalgin @irkjero
/tests @ivkalgin @irkjero
/onnx2torch @ivkalgin @senysenyseny16
/tests @ivkalgin @senysenyseny16

# Actions
/.github @senysenyseny16
32 changes: 15 additions & 17 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
python -m pip install -e .
- name: Analysing the code with pylint
run: |
pylint --rcfile .pylintrc --output-format=colorized $(git ls-files '*.py')
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
python -m pip install -e .[dev]
- name: Analysing the code with pylint
run: |
pylint --output-format=colorized $(git ls-files '*.py')

lint-python-format:
name: Python format
Expand All @@ -31,12 +31,10 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.9"
python-version: '3.9'
- uses: psf/black@stable
with:
options: "--check --diff"
options: --check --diff
- uses: isort/isort-action@master
with:
configuration:
--check
--diff
configuration: --check --diff
123 changes: 78 additions & 45 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,79 @@
default_install_hook_types: [commit-msg, pre-commit, pre-push]

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args:
[
"--force-single-line-imports",
"--ensure-newline-before-comments",
"--line-length=120",
"--profile=black",
]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-toml
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: no-commit-to-branch
args:
[
"-b=main",
]
- repo: https://github.com/PyCQA/pylint
rev: v2.16.0
hooks:
- id: pylint
args:
[
"-rn",
"-sn",
"--rcfile=.pylintrc",
"--output-format=colorized",
]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-toml
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- id: end-of-file-fixer
- id: debug-statements
- id: detect-private-key
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: no-commit-to-branch
args: [-b=main]

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.20.0
hooks:
- id: commitizen

- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- mdformat-black
- mdformat-shfmt

- repo: https://github.com/lyz-code/yamlfix
rev: 1.16.0
hooks:
- id: yamlfix

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args:
- --format
- parsable
- --strict
- -d
- '{extends: relaxed, rules: {line-length: {max: 120}}}'

- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/PyCQA/pylint
rev: v3.1.0
hooks:
- id: pylint
language: system
args: [-rn, -sn]

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.356
hooks:
- id: pyright
44 changes: 0 additions & 44 deletions .pylintrc

This file was deleted.

Loading
Loading