Skip to content
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

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/python_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +54 to +62
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 15, 2024

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. If autoflake is not installed by default, the job will fail due to the missing dependency.

+      - name: Install autoflake
+        run: poetry add --dev autoflake

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
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
autoflake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/python_prepare
- name: Install autoflake
run: poetry add --dev autoflake
- 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autoflake comes pre-installed

Copy link
Contributor

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
User: evangriffiths
PR: gnosis/prediction-market-agent#29
File: .github/workflows/python_ci.yaml:54-62
Timestamp: 2024-02-15T11:28:30.863Z
Learning: `autoflake` comes pre-installed in the environment set up by `.github/actions/python_prepare`.

Note: Learnings are effective only in the context of specific code segments. To apply general coding guidelines, please configure path-based instructions.


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
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the autoflake job, ensure isort is installed before attempting to run it. Add a step to install isort if it's not part of the environment prepared by .github/actions/python_prepare.

+      - name: Install isort
+        run: poetry add --dev isort

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
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
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/python_prepare
- name: Install isort
run: poetry add --dev isort
- name: Check with isort
run: |
poetry run isort --profile black .
git diff --exit-code --quiet || exit 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isort comes pre-installed

Copy link
Contributor

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 isort comes pre-installed. It seems no changes are necessary regarding the installation step for isort in the workflow. If there's anything else that needs attention, feel free to let me know.

Loading