Node-based CLI tool which finds variations of profane words within a set of given files and throws errors accordingly. Useful for preventing debug statements and unprofessional comments from being committed to git!
- Reports the line number and number of occurrences of detected profanity.
- Helps prevent committing those classic
- Can detect number/letter substitution (e.g.
H3110is parsed as
- Several command line options are available:
- Uses an array of ‘bad words’, unless provided with another set.
- This array is base64-encoded, to prevent profane language from appearing in other repos that have profamity as a dependency.
- Builds a set of regular expressions based on the given ‘bad words’.
- A set of letter/number substitutions are used to prevent leetspeak.
- This also lets us detect repeated letters (like
- For each file, loops over each line and checks if any of the regex’s match.