-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add samplr pre-commit hook and script
- Loading branch information
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
###################### | ||
# samplr configuration | ||
###################### | ||
|
||
# Want to include a header that indicates this is an autogenerated file? | ||
autogencomments: true | ||
|
||
# regex matches for filenames that you want to include or exclude from | ||
# the samplr generation. Be careful to indent using spaces. | ||
# For a file to be sampled, it has to meet both requirements: be included and not excluded. | ||
excludes: | ||
- \.sample # It's a good idea to exclude all *.sample* files, otherwise it will behave recursively | ||
- \.go$ # Most of the times, the code files won't need samples | ||
- ^vendor # Dependencies shouldn't be sampled | ||
- ^node-modules # Dependencies shouldn't be sampled | ||
includes: | ||
- ^config # Matches files like ./config/setup.yml or ./configuration/script.sh | ||
- \.yml$ # Matches all .yml files in the project | ||
- Dockerfile # Matches all Dockerfile in the project | ||
- .env # Matches all env files in the project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
############################### | ||
########### CREDITS: ########## | ||
# https://github.com/unmultimedio/samplr#5-set-up-a-githook-optional | ||
########## MODIFIED: ########## | ||
# t.hamoudi | ||
######### MAINTAINED: ######### | ||
# [email protected] | ||
############################### | ||
|
||
############################### | ||
# Prerequisites | ||
# - samplr v0.2.1 | ||
############################### | ||
###### INSTALLATION GUIDE ##### | ||
# https://github.com/unmultimedio/samplr/blob/master/INSTALL.md | ||
############################### | ||
|
||
set -e | ||
|
||
# Run samplr command to generate sample files | ||
samplr | ||
# List all changed and not-ignored files, with a filename that matches with ".sample", and add it to the commit | ||
git ls-files -mo --exclude-standard | grep "\.sample" | xargs git add |