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

feat(contributing): addition of a pre commit githook (formatting) and contributing doc #157

Merged
merged 1 commit into from
Jul 9, 2021

Conversation

dimakis
Copy link
Contributor

@dimakis dimakis commented Jul 9, 2021

Description

Describe your changes in detail
Addition of a pre-commit format check githook which uses go formatting tools under the hood.
Also addition of the commands to set it up for the project in the makefile and explained usage in newly created CONTRIBUTING.md doc.

Verification

  • Run make setup/git/hooks
  • Try and commit a go file with incorrect formatting
  • Should get a response to run make format to fix

Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    - [ ] Documentation change
    - [ ] Other (please specify)

Checklist

  • Documentation added for the feature
    - [ ] CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

Screenshots (if appropriate):

@@ -0,0 +1,30 @@
#!/bin/sh

staged_go_files=$(git diff --cached --name-only | grep ".go$")
Copy link
Contributor

Choose a reason for hiding this comment

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

Using make targets would be better but good for now

Copy link
Contributor

Choose a reason for hiding this comment

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

What I mean is that we should have go vet make target etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a quick win as I'm seeing alot of PRs failing for formatting errors. I'm not familiar with make targets. will have a look into them at some stage

@wtrocki wtrocki merged commit 7a82041 into aerogear:main Jul 9, 2021
@jjkiely
Copy link
Contributor

jjkiely commented Jul 9, 2021

Verified that it's working
image

@jjkiely
Copy link
Contributor

jjkiely commented Jul 9, 2021

Good stuff @dimakis

@dimakis dimakis deleted the chore_add-pre-commit-githook branch July 9, 2021 19:05
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

3 participants