Skip to content

Commit d4b946f

Browse files
committed
Add protip about disabling ExecutePermissions
Some people have been confused about how to use this hook when they have files that should have execute permissions (sds#339). I am hoping that this comment will help out future people.
1 parent ab1d8c9 commit d4b946f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/overcommit/hook/pre_commit/execute_permissions.rb

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ module Overcommit::Hook::PreCommit
22
# Checks for files with execute permissions, which are usually not necessary
33
# in source code files (and are typically caused by a misconfigured editor
44
# assigning incorrect default permissions).
5+
#
6+
# Protip: if you have some files that you want to allow execute permissions
7+
# on, you can disable this hook for those files by using the `exclude` option
8+
# on your .overcommit.yml file. Example:
9+
#
10+
# ExecutePermissions:
11+
# enabled: true
12+
# exclude:
13+
# - 'path/to/my/file/that/should/have/execute/permissions.sh'
14+
# - 'directory/that/should/have/execute/permissions/**/*'
515
class ExecutePermissions < Base
616
def run
717
file_modes = {}

0 commit comments

Comments
 (0)