Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lint] Add bat version and lint CI permission (#132)
1. Add bat version linter for Windows user 2. Add permission setting for third-party actions in lint.yaml to limit their access 3. Did some research and discussed with @justinchuby, CodeQL **only hints on the modified file in a PR**, and the error/warning/note are all informative, and aligned with pylint/mypy which are included in out lint, so I suggest we can have it for a while, and see how it goes. (However, disable one or few rules that we don't need in CodeQL seems doable in the next release: github/codeql#7937) fixes #127 Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
- Loading branch information
1 parent
e45e2bd
commit 05778ce
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
:: SPDX-License-Identifier: Apache-2.0 | ||
|
||
@echo off | ||
:: This script helps Windows user to format the code | ||
::before submitting the PR | ||
|
||
for /f %%i in ('git rev-parse --show-toplevel') do set root_path=%%i | ||
ECHO "Git Root PATH: %root_path%" | ||
CD /D %root_path% | ||
|
||
ECHO "\nblack reformatting..." | ||
black . --color | ||
ECHO "\nblack done!" | ||
|
||
ECHO "\nisort reformatting..." | ||
isort . --color | ||
ECHO "\nisort done!" | ||
|
||
PAUSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
:: SPDX-License-Identifier: Apache-2.0 | ||
|
||
@echo off | ||
:: This script helps Windows user to check formatting | ||
::before submitting the PR | ||
|
||
for /f %%i in ('git rev-parse --show-toplevel') do set root_path=%%i | ||
ECHO "Git Root PATH: %root_path%" | ||
CD /D %root_path% | ||
|
||
ECHO "\n::group:: ===> check flake8..." | ||
flake8 onnxscript | ||
ECHO "::endgroup::" | ||
|
||
ECHO "\n::group:: ===> check isort..." | ||
isort . --color --diff --check | ||
ECHO "::endgroup::" | ||
|
||
ECHO "\n::group:: ===> check black format..." | ||
black . --color --diff --check | ||
ECHO "::endgroup::" | ||
|
||
PAUSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
:: SPDX-License-Identifier: Apache-2.0 | ||
|
||
@echo off | ||
:: This script helps Windows user to check formatting | ||
::before submitting the PR | ||
|
||
for /f %%i in ('git rev-parse --show-toplevel') do set root_path=%%i | ||
ECHO "Git Root PATH: %root_path%" | ||
CD /D %root_path% | ||
|
||
ECHO "\n::group:: ===> check pylint" | ||
pylint onnxscript | ||
ECHO "::endgroup::" | ||
|
||
ECHO "\n::group:: ===> check mypy" | ||
mypy onnxscript --config-file pyproject.toml | ||
ECHO "::endgroup::" | ||
|
||
PAUSE |