Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implemented a pre-commit hook to promote naming consistency across YAML #51

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

l50
Copy link
Contributor

@l50 l50 commented Aug 31, 2023

Proposed Changes

Implemented a git pre-commit hook that enforces a naming convention for YAML files and directories. The hook ensures that any committed YAML files or directories with underscores in their names are automatically renamed to use dashes. This change also includes BATS tests to validate the functionality of the hook.

Related Issue(s)

N/A

Testing

  1. Created a BATS test suite that verifies:

    • If underscores in filenames are correctly replaced with dashes.
    • If old filenames with underscores are not staged after the renaming.
  2. Manual testing by staging files and directories with underscores and observing the changes post-hook execution.

Documentation

The script itself has inline comments detailing its purpose and functionality. No additional external documentation has been provided.

Screenshots/GIFs (optional)

N/A

Checklist

  • Ran mage runprecommit locally and fixed any issues that arose.
  • Curated your commit(s) so they are legible and easy to read and understand.
  • 🚀

files and directories, supplemented with a test suite for verification,
and fine-tuned our pre-commit configuration for enhanced hook management.

- Introduced a pre-commit hook to ensure consistent naming in YAML files and directories, replacing underscores with dashes.
- Added a BATS test suite to validate the new hook's functionality.
- Modified .pre-commit-config.yaml for improved hook configuration and exclusions.
@l50 l50 added the area/pre-commit Changes made to pre-commit hooks label Aug 31, 2023
@l50 l50 enabled auto-merge (squash) August 31, 2023 06:23
@l50 l50 requested a review from cedowens August 31, 2023 06:23
@l50 l50 merged commit 8e73f47 into facebookincubator:main Sep 1, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/pre-commit Changes made to pre-commit hooks cla signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants