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

Adds pre-commit for auto ruff before commit #40

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

sherjeelshabih
Copy link
Collaborator

@sherjeelshabih sherjeelshabih commented Dec 2, 2024

Developers

It's nice to not miss a ruff format before pushing your commits. To set up pre-commit hook:

   pip install pre-commit
   pre-commit install

Summary by Sourcery

Introduce a pre-commit hook configuration to automatically run Ruff linter and formatter before commits, and update the README with setup instructions for developers.

Build:

  • Add a pre-commit configuration file to automate running Ruff linter and formatter before commits.

Documentation:

  • Update README with instructions for setting up pre-commit hooks for Ruff.

Copy link

sourcery-ai bot commented Dec 2, 2024

Reviewer's Guide by Sourcery

This PR adds pre-commit configuration to automatically run Ruff (linter and formatter) before each commit. The implementation consists of adding a new pre-commit configuration file and updating the README with setup instructions.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added pre-commit configuration for Ruff linting and formatting
  • Configured Ruff linter hook
  • Configured Ruff formatter hook
  • Set Ruff version to v0.8.1
.pre-commit-config.yaml
Updated documentation with pre-commit setup instructions
  • Added developer section with pre-commit installation steps
  • Included commands for installing and setting up pre-commit
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sherjeelshabih - I've reviewed your changes - here's some feedback:

Overall Comments:

  • There's a typo in the README: 'fromat' should be 'format'
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

README.md Outdated Show resolved Hide resolved
@sherjeelshabih sherjeelshabih merged commit 06c9272 into main Dec 4, 2024
7 checks passed
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.

2 participants