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:
Justin Chu 2023-04-26 14:04:07 -07:00 committed by GitHub
parent d7ba9814cf
commit 76ddc92fbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 34 deletions

View file

@ -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

View file

@ -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).

View file

@ -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