Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
A @console_rule for validating source files against regexes. #7515
This can be used e.g., for checking header comments in a uniform way, instead of relying on per-language linters.
The validator configuration contains three elements: A set of path patterns, a set of content patterns, and a set of requirements mapping path patterns to content patterns. Meaning: If a file matches some path pattern, its content must match all the corresponding content patterns.
This change also includes an application of this rule to check for Python and JVM source file headers in the pants codebase, as a demonstration. Not all our source files pass it yet, but most do.