Devanik21 / ISRO_Mining_Site_FINAL_APP

9 stars 34 forks source link

Add Pre-commit Hooks for Code Formatting and Linting #77

Open Vikranth3140 opened 1 day ago

Vikranth3140 commented 1 day ago

To ensure consistent code style and formatting across the entire repository, we need to implement pre-commit hooks that automatically handle formatting and linting for multiple file types. This will improve code quality, catch errors early, and maintain clean code standards.

File Types to be Covered:

Tasks:

  1. Add a .pre-commit-config.yaml file in the root directory of the repository.
  2. Configure the following pre-commit hooks:
    • Black: For automatic code formatting for Python and Jupyter Notebooks.
    • Flake8: For linting Python files and Jupyter Notebooks.
    • nbQA: To apply Black and Flake8 formatting and linting to Jupyter Notebooks (.ipynb).
    • Check YAML: To validate the format of YAML files.
    • Markdownlint: To ensure style consistency in Markdown files.
    • Trailing Whitespace, End-of-file fixer, and Check-merge-conflict: For cleaning up text files and ensuring proper file formatting.
  3. Install and activate the pre-commit hooks with the pre-commit install command.
  4. Run pre-commit run --all-files to apply the hooks to the entire codebase.

By implementing these hooks, we can maintain consistent formatting across all relevant file types and automatically prevent common formatting issues before code is committed.

github-actions[bot] commented 1 day ago

👋 Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!

Vikranth3140 commented 6 hours ago

Hey @Devanik21, I have already submitted the PR #79 to cover this.

Please crosscheck the pre-commit hooks i have added.