-
Notifications
You must be signed in to change notification settings - Fork 71
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
Provide a default overcommit config file #335
Conversation
Hooks are only enabled if you take action. To enable the hooks run: ``` bundle install bundle exec overcommit --install bundle exec overcommit --sign ``` (it will manage the .git/hooks directory): Examples howto skip a test for a commit or push: ``` SKIP=RuboCop git commit SKIP=PuppetLint git commit SKIP=RakeTask git push ``` Don't invoke overcommit at all: ``` OVERCOMMIT_DISABLE=1 git commit ``` Read more about overcommit: https://github.com/brigade/overcommit Things to dicuss: * what to run on PrePush (see hook list on github) * what to run on PrePreCommit (see hook list on github) * there are also few that are enabled by default (see github overcommit README.md - the ones with * prefix in the hook list) * do we need to exclude some directories by default (consider: the non-rake tasks are only run if a changed file matches an include rule)? * i thought about making it configureable with .sync.yml but then decided to do it when its really required (maybe only few will use this overcommit thing because it needs manual action to enable it)
I've run |
RuboCop: | ||
enabled: true | ||
description: 'Runs rubocop on modified files only' | ||
command: ['bundle', 'exec', 'rubocop'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use the rake task here? Or as an alternative:
bundle exec rubocop -c .rubocop.yml -D -S
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RakeTask rubocop will run on every commit. RuboCop task will only run if there is a ruby file involved with the commit.
as commit needs to be fast i've choosen the builtin tasks instead of the file unaware rake-task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the command is maybe missleading. overcommit will not just run plain rubocop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/brigade/overcommit/blob/master/config/default.yml#L504 is what it adds as params.
Hooks are only enabled if you take action.
To enable the hooks run:
(it will manage the .git/hooks directory):
Examples howto skip a test for a commit or push:
Don't invoke overcommit at all:
Read more about overcommit: https://github.com/brigade/overcommit
Things to discuss:
tasks are only run if a changed file matches an include rule)?
it when its really required (maybe only few will use this overcommit thing
because it needs manual action to enable it)