Skip to content

Add .pre-commit-config.yml file with pre-commit hooks #955

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

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

cegekaJG
Copy link
Contributor

@cegekaJG cegekaJG commented Feb 27, 2024

This pull request adds a .pre-commit-config.yaml file to the repository, which includes pre-commit hooks for code formatting and quality checks.

The hooks can be installed locally using this guide to check for and rectify any violations before committing files, but using pre-commit.ci, it's also possible to register this repository to be automatically corrected and updated by a bot. This way, any pull requests for this project will either always adhere to guidelines defined by the hooks, or fail a status check if they require manual adjustments.

To enable pre-commit.ci, it's important to log into the service and authorize access to this repository. Beyond that, no further action is required.

Here's a list of all the hooks added with the .pre-commit-config.yml file. All of them pass after a single autofix commit.

  • executablebooks/mdformat/mdformat
  • pre-commit/pre-commit-hooks/check-added-large-files
  • pre-commit/pre-commit-hooks/check-case-conflict
  • pre-commit/pre-commit-hooks/check-json
  • pre-commit/pre-commit-hooks/check-xml
  • pre-commit/pre-commit-hooks/check-yaml
  • pre-commit/pre-commit-hooks/check-merge-conflict
  • pre-commit/pre-commit-hooks/detect-private-key
  • pre-commit/pre-commit-hooks/end-of-file-fixer
  • pre-commit/pre-commit-hooks/trailing-whitespace
  • pre-commit/pre-commit-hooks/mixed-line-ending
  • pre-commit/pre-commit-hooks/sort-simple-yaml

@cegekaJG cegekaJG requested a review from a team as a code owner February 27, 2024 09:45
@cegekaJG
Copy link
Contributor Author

This has been requested for review for almost 2 months now - can someone look at this already? If there's something missing or you need more information, please let me know.

@mazhelez
Copy link
Collaborator

Hey @cegekaJG

First of all, thank you for taking the time to contribute to the AL-Go repository.

The PR looks okay. However, there's a certain process when using 3rd party frameworks for Microsoft projects, so the ball is on us to figure it out.

We'll keep you posted.

Copy link
Collaborator

@aholstrup1 aholstrup1 left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 I've opened up a follow up PR to fix the findings by the pre-commit hooks #1112

@aholstrup1 aholstrup1 merged commit 881a7e7 into microsoft:main Jun 21, 2024
4 checks passed
@cegekaJG cegekaJG deleted the pre-commit-config branch June 21, 2024 11:29
freddydk added a commit that referenced this pull request Jun 24, 2024
…1112)

This PR should go in after #955

This PR:
* Fixes all the issues found by the pre-commit hooks (by running
`pre-commit run --all-files`)
* Adds a check on future AL-Go PRs to ensure the pre-commit hooks have
been run.

---------

Co-authored-by: Freddy Kristiansen <[email protected]>
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.

3 participants