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

Please add configurable git precommit hooks for different languages #192

Closed
vpaslav opened this issue Sep 23, 2019 · 3 comments
Closed

Please add configurable git precommit hooks for different languages #192

vpaslav opened this issue Sep 23, 2019 · 3 comments
Labels

Comments

@vpaslav
Copy link

vpaslav commented Sep 23, 2019

A problem/task I want to solve

During development cycle it's really great to ensure that badly formatted code or even syntax errors won't be committed into repository and code is covered with unit tests. So, I propose to add precommit git hooks that will run different verifications. For python, for instance, we can run flake8, pytest and coverage.

The solution I'd like

During application configuration I would like to see an option for which language I need verifications, what automatically install all necessary tools or propose "how to configure" steps.

@extsoft
Copy link
Contributor

extsoft commented Sep 27, 2019

@vpaslav thank you for proposing this.

I would suggest the following flow:

  1. Ask a user if a git pre-commit hook is needed
  2. If yes, create a "hello world" hook and print some instructions

@vpaslav is it what you are looking for?

extsoft added a commit that referenced this issue Oct 18, 2019
A workflow is a sequence of actions that is performed to complete a
contribution cycle. An action is an executable script that does all
required additional actions prior to or after an Elegant Git command.

#192
3
extsoft added a commit that referenced this issue Oct 18, 2019
A workflow is a sequence of actions that is performed to complete a
contribution cycle. An action is an executable script that does all
required additional actions prior to or after an Elegant Git command.

#192
@extsoft extsoft mentioned this issue Oct 18, 2019
4 tasks
extsoft added a commit that referenced this issue Oct 21, 2019
Sometimes, a user may want to ignore defined workflows and just execute
a pure command. And `--no-workflows` option is designed to implement
this behavior. This option can be put prior or after the command. This
gives more flexibility in usage. However, `git-elegan --no-workflows
<command>` is preffered as it encourages to split Elegant Git options
and command arguments. Bash completion is updated appropriately.

Also, two improvements:
1. The `version` file will be removed prior to actual test execution.
This exposes the mentioned behavior for any place where
`.workflows/bats-pipeline.bash` is used.
2. Remove `-v` option (was equal to `--version`) as, in Git, `-v` stands
for `--verbose`.

#192
@extsoft extsoft mentioned this issue Oct 21, 2019
4 tasks
@extsoft
Copy link
Contributor

extsoft commented Oct 21, 2019

@vpaslav Now it's possible to configure custom workflows. So, you can add any hooks you need. Possible, in the future, we are going to add some predefined workflows in a separate repository.

@extsoft extsoft closed this as completed Oct 21, 2019
@vpaslav
Copy link
Author

vpaslav commented Oct 21, 2019

@extsoft cool, I'll check this feature soon. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants