Skip to content
Open
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
37 changes: 0 additions & 37 deletions .github/workflows/general-linting.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: General Linting

on:
pull_request:
push:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
hooks:
- id: ruff
- repo: https://github.com/pycqa/isort
rev: 6.0.0
hooks:
- id: isort
name: isort (python)
args: [--check-only]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude: "m3/eval/scripts/mimic_vqa/glossary.py"
args: ['--ignore-words-list=rouge']
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Please visit the [VILA-M3 Demo](https://vila-m3-demo.monai.ngc.nvidia.com/) to t
To lint the code, please install these packages:

```bash
pip install -r requirements-ci.txt
pip install pre-commit
```

Then run the following command:
Expand Down
31 changes: 13 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
[tool.black]
line-length = 122
include = '\.pyi?$'
exclude = '''
/(
build
| docs
| setup\.py
| thirdparty
| \.venv.*
| .*test_.*
| \.mypy_cache
| \.vscode
)/
'''

[tool.isort]
profile = "black"

multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 122
line_length = 120
py_version = 310
group_by_package = true

skip_glob = [
"build/*",
"docs/*",
Expand All @@ -30,3 +17,11 @@ skip_glob = [
"*test_*",
"./.vscode/*",
]

[tool.ruff]
line-length = 120
exclude = [
"docs/",
"venv*/",
]
target-version = "py310"
3 changes: 0 additions & 3 deletions requirements-ci.txt

This file was deleted.

15 changes: 0 additions & 15 deletions ruff.toml

This file was deleted.