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

Add some protips #340

Merged
merged 2 commits into from
Feb 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/overcommit/hook/pre_commit/es_lint.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
module Overcommit::Hook::PreCommit
# Runs `eslint` against any modified JavaScript files.
#
# Protip: if you have an npm script set up to run eslint, you can configure
# this hook to run eslint via your npm script by using the `command` option in
# your .overcommit.yml file. This can be useful if you have some eslint
# configuration built into your npm script that you don't want to repeat
# somewhere else. Example:
#
# EsLint:
# enabled: true
# command: ['npm', 'run', 'lint']
#
# @see http://eslint.org/
class EsLint < Base
def run
Expand Down
10 changes: 10 additions & 0 deletions lib/overcommit/hook/pre_commit/execute_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ module Overcommit::Hook::PreCommit
# Checks for files with execute permissions, which are usually not necessary
# in source code files (and are typically caused by a misconfigured editor
# assigning incorrect default permissions).
#
# Protip: if you have some files that you want to allow execute permissions
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this just basic functionality available to every hook? Does it warrant a protip?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it is. But, since people are filing issues asking this question, I think that is evidence enough that it could save people time to have a note here. It helps them apply the feature for this case, which I think is a win.

# on, you can disable this hook for those files by using the `exclude` option
# on your .overcommit.yml file. Example:
#
# ExecutePermissions:
# enabled: true
# exclude:
# - 'path/to/my/file/that/should/have/execute/permissions.sh'
# - 'directory/that/should/have/execute/permissions/**/*'
class ExecutePermissions < Base
def run
file_modes = {}
Expand Down