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 Pre-commit Hooks and Documentation to Development Environment #219

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

KesharwaniArpita
Copy link
Contributor

@KesharwaniArpita KesharwaniArpita commented Oct 22, 2024

Contributor checklist


Description

This PR adds pre-commit hooks and related documentation regarding the setup and usage of pre-commit hooks to ensure a cleaner, more consistent codebase for Scribe-Android. The pre-commit hooks will help contributors automatically check for code quality issues, such as trailing whitespaces, missing newlines, and linting errors, before committing their changes.

Changes Introduced:

  • Added Pre-Commit hooks.
  • Added a new section in the Development Environment documentation explaining how to set up and use pre-commit hooks.
  • Included a detailed list of pre-commit hooks currently configured for Scribe-Android.
  • Provided instructions for installing, configuring, and manually running the pre-commit checks.

Pre-commit Hooks Configured:

  • trailing-whitespace: Removes trailing whitespaces in code.
  • end-of-file-fixer: Ensures files end with a newline.
  • ruff: Lints Python code for Python scripts used in the project.

Manual Command for Running Pre-commit Hooks:

pre-commit run --all-files

Testing Steps:

  1. Follow the updated documentation to set up the pre-commit hooks in your local environment.
  2. Make a commit and confirm that the pre-commit hooks run automatically.
  3. Optionally, run the hooks manually with pre-commit run --all-files to ensure everything works as expected.

Related issue

Copy link

github-actions bot commented Oct 22, 2024

Thank you for the pull request!

The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Android rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!

Maintainer checklist

  • The linting and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

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

Thanks for this, @KesharwaniArpita!

@andrewtavis andrewtavis merged commit 9d7987c into scribe-org:main Oct 22, 2024
2 checks passed
@KesharwaniArpita KesharwaniArpita deleted the AK-Config branch October 24, 2024 15:12
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