anarchy-ai / LLM-VM

irresponsible innovation. Try now at https://chat.dev/
https://anarchy.ai/
MIT License
477 stars 148 forks source link

Add Pre-commit Support for Code Quality Assurance #271

Open sushmanthreddy opened 1 year ago

sushmanthreddy commented 1 year ago

Description:

To ensure consistent code quality and style across the repository, I propose adding pre-commit support. Pre-commit hooks can help automate several tasks before commits, such as code formatting, linting, and running basic tests.

Benefits:

  1. Consistent Code Style: By using tools like black or yapf, we can ensure that the codebase has a consistent style, making it more readable and maintainable.
  2. Catch Issues Early: Linters like flake8 or pylint can catch common Python mistakes before they're committed.
  3. Automate Processes: Instead of manually running formatters or linters, developers can rely on these tools to run automatically, ensuring that only quality code gets committed.
  4. Reduce Review Overhead: With automated checks in place, code reviewers can focus on the logic and structure of the code rather than style or basic issues.

Proposed Steps:

  1. Add a .pre-commit-config.yaml file to the root of the repository.
  2. Define the desired hooks, such as black, flake8, etc.
  3. Update the README.md or contributing guidelines to instruct developers on how to set up pre-commit in their local development environment.
  4. Optionally, integrate with CI/CD to ensure that commits and PRs adhere to the defined hooks.

Additional Resources:

I believe that adding pre-commit support will significantly enhance our development workflow and ensure a higher code quality standard. Looking forward to feedback on this proposal!

mmirman commented 1 year ago

We may need CI hooks first

horahoradev commented 11 months ago

I'd be interested in working on this. I can do both the linting config + CI via Github Actions.