Run rustfmt in CI (#15217)

I considered running clippy as well but ort takes too long to build
This commit is contained in:
Justin Chu 2023-03-27 08:12:59 -07:00 committed by GitHub
parent b10aaf4e9c
commit e754edaecf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -40,6 +40,11 @@ jobs:
with:
# Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset.
python-version: "3.10"
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Install dependencies
run: |
python -m pip install -r requirements-dev.txt

View file

@ -152,3 +152,19 @@ init_command = [
'--dry-run={{DRYRUN}}',
'pylint==2.15.5',
]
[[linter]]
code = 'RUSTFMT'
include_patterns = ['**/*.rs']
command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'rustfmt_linter',
'--binary=rustfmt',
'--config-path=rust/rustfmt.toml',
'--',
'@{{PATHSFILE}}'
]
is_formatter = true