-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add isort and autoflake to CI #29
Changes from 1 commit
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 | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -50,3 +50,23 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||
- uses: ./.github/actions/python_prepare | ||||||||||||||||||||||||||||||||||||||||||
- name: Check with black | ||||||||||||||||||||||||||||||||||||||||||
run: poetry run black --check . | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
autoflake: | ||||||||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||||||
- uses: actions/checkout@v2 | ||||||||||||||||||||||||||||||||||||||||||
- uses: ./.github/actions/python_prepare | ||||||||||||||||||||||||||||||||||||||||||
- name: Check with autoflake | ||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||
poetry run autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive . | ||||||||||||||||||||||||||||||||||||||||||
git diff --exit-code --quiet || exit 1 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
isort: | ||||||||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||||||
- uses: actions/checkout@v2 | ||||||||||||||||||||||||||||||||||||||||||
- uses: ./.github/actions/python_prepare | ||||||||||||||||||||||||||||||||||||||||||
- name: Check with isort | ||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||
poetry run isort --profile black . | ||||||||||||||||||||||||||||||||||||||||||
git diff --exit-code --quiet || exit 1 | ||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+64
to
+72
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. Similar to the + - name: Install isort
+ run: poetry add --dev isort Committable suggestion
Suggested change
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. isort comes pre-installed 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. @evangriffiths: Understood, thank you for clarifying that |
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.
Consider adding a step to install
autoflake
before running it, unless it's guaranteed to be available in the environment set up by.github/actions/python_prepare
. Ifautoflake
is not installed by default, the job will fail due to the missing dependency.Committable suggestion
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.
autoflake comes pre-installed
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.
@evangriffiths: Understood, thank you for clarifying that
autoflake
comes pre-installed. This ensures the workflow setup is streamlined and efficient. If there's anything else you need, feel free to let me know!New Learnings Added