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: introduce precommit target #309

Merged
merged 2 commits into from
May 6, 2024
Merged

feat: introduce precommit target #309

merged 2 commits into from
May 6, 2024

Conversation

tomMoulard
Copy link
Contributor

@tomMoulard tomMoulard commented May 1, 2024

This PR introduces a precommit target that could be run before pushing anything to the main branch.

The motive is that the vuln recipe is quite slow to run, and is not needed during fast testing feedback code.
Therefore, it should not be used as regularly as the all recipe, but should often run, and must always be called by the CI.

This PR closes #308.

Here is a little flowchart

flowchart TD
    A[Codding something] --> C{Are the tests valid ?
    `make`}
    C -->|Yes| D{Do I want to commit ?
    `make precommit`}
    C -->|No| A
    D -->|yes| E{Is the commit valid on the pushed branch ?
    `make ci`}
    D -->|No| A
    E-->|yes| F[Successfull PR]
    E-->|no| A
Loading

Copy link

codecov bot commented May 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.00%. Comparing base (28304aa) to head (af0836e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #309   +/-   ##
=======================================
  Coverage   50.00%   50.00%           
=======================================
  Files           1        1           
  Lines           4        4           
=======================================
  Hits            2        2           
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pellared
Copy link
Member

pellared commented May 6, 2024

I really like this PR.

Can we just rename all to precommit and precommit to all?
all suggests that it is something "bigger" (a superset).
Then precommit should be the default target.

@tomMoulard
Copy link
Contributor Author

tomMoulard commented May 6, 2024

I did not do that because for me the all target is not there to check that the code is valid for a commit. It is rather here to build the program.
I can change this either way if you want 😄

@pellared
Copy link
Member

pellared commented May 6, 2024

I did not do that because for me the all target is not there to check that the code is valid for a commit. It is rather here to build the program. I can change this either way if you want 😄

Leave it as it is. Merging. Thanks.

PS. I was not aware of https://www.gnu.org/software/make/manual/html_node/Standard-Targets.html

@pellared pellared merged commit a625306 into golang-templates:main May 6, 2024
7 checks passed
@tomMoulard tomMoulard deleted the feat/precommit branch May 6, 2024 09:17
@pellared pellared mentioned this pull request Jul 30, 2024
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.

Introduce precommit target
2 participants