Skip to content

✨ Add pre-commit hook#221

Open
derekrgreene wants to merge 1 commit intoGDQuest:mainfrom
derekrgreene:main
Open

✨ Add pre-commit hook#221
derekrgreene wants to merge 1 commit intoGDQuest:mainfrom
derekrgreene:main

Conversation

@derekrgreene
Copy link
Copy Markdown

Please check if the PR fulfills these requirements:

  • The commit message follows our guidelines.
  • For bug fixes and features:
    • You tested the changes.

Related issue (if applicable): #141

What kind of change does this PR introduce?

  • New feature

Does this PR introduce a breaking change?

  • No

New feature or change

What is the current behavior?

There is no .pre-commit-hooks.yaml, so users who want to use gdscript-formatter as a pre-commit hook have to configure it manually.

What is the new behavior?

Users can reference this repo directly in their .pre-commit-config.yaml:

repos:
- repo: https://github.com/GDQuest/GDScript-formatter
    rev: 0.19.0                                                                                                                                                                  
    hooks:                                                                                                                                                                     
    - id: gdscript-formatter                                                                                                                                                     

Other information

Fixes #141

@NathanLovato
Copy link
Copy Markdown
Contributor

Okay, so from what I gather, this pre-commit thing is actually a Python framework that people have to install just to be able to reference hooks from a repository, right? If so, could you please briefly document the setup that people need to go through to actually use this?

A feature like this is a bit niche, I think, and even more so if people need to already know about the specific tool and have it installed beforehand.

I would also personally start by giving them an example of how to use an actual standard Git hook, which takes minutes to set up, and then mention that there is this convenience feature on top of that for those who want it (but it's not strictly necessary, it's a small extra convenience).

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.

Add a pre-commit hook to easily install and use the formatter as a commit hook

2 participants