-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Lint] Add bat version and lint CI permission #132
Changes from all commits
d32e4ae
ee7a1a1
c555c20
a4f5e67
9bfd950
5f3a914
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,19 @@ jobs: | |
lint-python: | ||
name: Lint Python | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: write | ||
checks: write | ||
contents: write | ||
deployments: none | ||
id-token: write | ||
issues: none | ||
discussions: none | ||
packages: none | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. none fields can be removed because "If you specify the access for any of these scopes, all of those that are not specified are set to none." https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think one of the benefits of leaving it there is that the next person, who needs to change the permission, can see what options he/she has on this (No need to investigate again). Besides, we are not adding more lines on this. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds good to me |
||
pull-requests: write | ||
repository-projects: none | ||
security-events: none | ||
statuses: read | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
|
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 |
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 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I referenced from Pytorch/TensorRT setting, which is also using third-party actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think only
lint-python
will need to set permissions because others don't use 3p actions.