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

Setup black and ruff linter check #42

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

felipeall
Copy link
Owner

@felipeall felipeall commented Nov 1, 2023

Summary by CodeRabbit

Style:

  • Renamed the workflow from "Ruff" to "Linter Check" for better clarity and understanding.
  • Added a new step called "black" to check the code formatting, ensuring the code adheres to a consistent style.

These changes will not directly impact end-users but will enhance the code quality and maintainability for developers.

Copy link

vercel bot commented Nov 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
transfermarkt-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2023 7:19pm

Copy link

coderabbitai bot commented Nov 1, 2023

Walkthrough

The changes made to the workflow file in the GitHub actions directory primarily involve renaming the workflow and adding a new step for code formatting check using the "black" Python package.

Changes

File Path Summary
.github/workflows/.../check.yml The workflow name has been changed from "Ruff" to "Linter Check". A new step named "black" has been added, which installs the "black" package and runs a code formatting check.

Poem

🍂 As November winds do blow,
In the world of code, we sow.
From "Ruff" to "Linter Check" we leap,
Ensuring our code's beauty, we keep. 🐇

With "black" now in our toolset's rack,
No formatting errors shall we lack.
As leaves fall and seasons change,
Our code too, we rearrange. 🍁

So here's to autumn's coding spree,
In a world as inclusive as can be.
With each commit, pull, and push,
Towards perfection, we rush. 🌍🚀


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

@felipeall felipeall merged commit 0f68120 into main Nov 1, 2023
3 checks passed
@felipeall felipeall deleted the github/gh-actions-linter branch November 1, 2023 19:20
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7ca4eb1 and 2e9e6d3.
Files selected for processing (1)
  • .github/workflows/check.yml (2 hunks)
Additional comments: 1
.github/workflows/check.yml (1)
  • 1-12: The workflow is triggered on both push and pull request events on the main branch. The job runs on an Ubuntu 20.04 runner and checks out the code using the actions/checkout@v3 action. This is a standard setup for a GitHub Actions workflow.

Comment on lines 15 to +21
run: |
pip install ruff
ruff check .
- name: black
run: |
pip install black
black --check .
Copy link

Choose a reason for hiding this comment

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

The workflow installs and runs two linters: ruff and black. Both linters are installed and run in separate steps, which is a good practice as it isolates the execution of each linter. However, consider using a Python dependency management tool like pipenv or poetry to manage these dependencies. This can help to ensure that the correct versions of the linters are always used.

        run: |
          pip install ruff
          ruff check .
      - name: black
        run: |
-         pip install black
+         pip install poetry
+         poetry add black
          black --check .

Commitable suggestion (Beta)
Suggested change
run: |
pip install ruff
ruff check .
- name: black
run: |
pip install black
black --check .
run: |
pip install ruff
ruff check .
- name: black
run: |
+ pip install poetry
+ poetry add black
black --check .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant