This file contains hidden or 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
(?<![\S"])([^"\s]+)(?![\S"]) | |
Find all strings not enclosed in quotes. Workx ok well. Often used to add quotes to JSON notation that doesn't have it yet. Currently doesn't detect brackets like [, [, }. That needs some fixing. | |
Source: https://stackoverflow.com/questions/11324749/a-regex-to-detect-string-not-enclosed-in-double-quotes |
This file contains hidden or 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
#!/bin/bash | |
# Pre commit hook that prevents FORBIDDEN code from being commited. | |
# Add unwanted code to the FORBIDDEN array as necessary | |
FILES_PATTERN='\.(rb|js|coffee|erb|scss|css)(\..+)?$' | |
FORBIDDEN=( TODO binding.pry FIXME ) | |
for i in "${FORBIDDEN[@]}" | |
do |