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] Introduce Pre-Commit Hooks and Configuration Files #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yhna940
Copy link
Contributor

@yhna940 yhna940 commented May 12, 2023

Description

This commit introduces a pre-commit configuration file and a setup configuration file to improve the code quality and maintainability of the project.

Changes:

  1. A new .pre-commit-config.yaml file has been added, which includes several hooks to maintain code quality and consistency. These hooks include:
    • flake8 for Python style guide enforcement
    • isort for sorting imports
    • yapf for auto-formatting Python code
    • trailing-whitespace, check-yaml, end-of-file-fixer, requirements-txt-fixer, double-quote-string-fixer, check-merge-conflict, fix-encoding-pragma, mixed-line-ending for various code cleanup and sanity checks
    • mdformat for Markdown formatting
    • codespell for spell checking
    • docformatter for Python docstring formatting
    • pyupgrade for upgrading Python syntax
  2. A new setup.cfg file has been added, which includes configuration settings for yapf and isort.

These changes should help in maintaining the quality of the codebase, enforcing coding standards, and making the review process smoother and more efficient.

setup.cfg Outdated
known_first_party = mmgpt
known_third_party = PIL,cv2,mmcv,numpy,pytest,mmengine,torch
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems this file should have an empty line in the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out. I've added an empty line at the end of the file as suggested. Please let me know if there are any other changes needed.

@yhna940 yhna940 requested a review from ZwwWayne June 4, 2023 01:44
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.

None yet

2 participants