I have a precommit file which checks for commented line format in .cfg files. The current comment style is a semicolon, so this will fail if a pound sign is used for file comments. Can RegEx somehow be used to match multiple comment patterns? For example:
- --comment-style
- ';'|'#'|'some other comment'
files: |
(?x)(
\.cfg
)$
This is the source of the precommit test:
https://github.com/Lucas-C/pre-commit-hooks/blob/master/tests/insert_license_test.py
Thanks.
it cannot
parser.add_argument('--comment-style', default='#',
help='Can be a single prefix or a triplet: '
'<comment-start>|<comment-prefix>|<comment-end>'
'E.g.: /*| *| */')
there is only one comment type that is allowed by that hook