mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-30 03:37:44 +00:00
Enable RUFF as a formatter (#15699)
### Description RUFF can now format since lintrunner-adapters v0.8. Removed the RUFF-FIX linter. ### Motivation and Context Better engineering
This commit is contained in:
parent
d7ba9814cf
commit
76ddc92fbd
3 changed files with 10 additions and 34 deletions
|
|
@ -64,36 +64,6 @@ init_command = [
|
|||
'--dry-run={{DRYRUN}}',
|
||||
'--requirement=requirements-lintrunner.txt',
|
||||
]
|
||||
|
||||
[[linter]]
|
||||
code = 'RUFF-FIX'
|
||||
include_patterns = [
|
||||
'**/*.py',
|
||||
'**/*.pyi',
|
||||
]
|
||||
exclude_patterns = [
|
||||
'cmake/external/**',
|
||||
# ignore generated flatbuffers code
|
||||
'onnxruntime/core/flatbuffers/ort_flatbuffers_py/**',
|
||||
]
|
||||
command = [
|
||||
'python',
|
||||
'-m',
|
||||
'lintrunner_adapters',
|
||||
'run',
|
||||
'ruff_fix_linter',
|
||||
'--config=pyproject.toml',
|
||||
'@{{PATHSFILE}}'
|
||||
]
|
||||
init_command = [
|
||||
'python',
|
||||
'-m',
|
||||
'lintrunner_adapters',
|
||||
'run',
|
||||
'pip_init',
|
||||
'--dry-run={{DRYRUN}}',
|
||||
'--requirement=requirements-lintrunner.txt',
|
||||
]
|
||||
is_formatter = true
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,13 @@ If you want to see what lintrunner init will install, run
|
|||
To lint local changes:
|
||||
|
||||
```bash
|
||||
lintrunner -m main
|
||||
lintrunner
|
||||
```
|
||||
|
||||
To format files and apply suggestions:
|
||||
|
||||
```bash
|
||||
lintrunner -a
|
||||
```
|
||||
|
||||
To lint all files:
|
||||
|
|
@ -176,10 +182,10 @@ To lint all files:
|
|||
lintrunner --all-files
|
||||
```
|
||||
|
||||
To format files:
|
||||
To show help text:
|
||||
|
||||
```bash
|
||||
lintrunner -a --all-files
|
||||
lintrunner -h
|
||||
```
|
||||
|
||||
To read more about lintrunner, see [wiki](https://github.com/pytorch/pytorch/wiki/lintrunner).
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# This file is auto updated by dependabot
|
||||
lintrunner-adapters
|
||||
lintrunner-adapters>=0.8.0
|
||||
# RUFF, RUFF-FIX
|
||||
ruff==0.0.261
|
||||
# BLACK-ISORT
|
||||
|
|
|
|||
Loading…
Reference in a new issue