hundreds-father-404
01/14/2022, 6:42 PMvalidate
goal, but I'm merging that goal into lint
Some ideas:
• sourcefile-validation
• regex-validator
chilly-magazine-21545
01/14/2022, 6:46 PMhundreds-father-404
01/14/2022, 6:48 PMregex-validator
a lot too. Indeed, it can be used for any arbitrary regexcurved-television-6568
01/14/2022, 7:00 PMregex-validator
name, feels like its purpose is to validate regex’es.sourcefile-validation
is a bit cumbersome, but more to the point, imo.assert-patterns
.. ? I’m unable to come up with something I feel strongly for, so.. either way, I guess for me 🙂proud-dentist-22844
01/14/2022, 7:14 PMhundreds-father-404
01/14/2022, 7:17 PMassert-patterns
, I think we probably want a noun because it's going to show up in messages like
Flake8 succeeded
regex-validator failed
But it could be pattern-checker
for exampleproud-dentist-22844
01/14/2022, 7:24 PMdo-that-thinger
succeeded…regextioneer
curved-television-6568
01/14/2022, 7:29 PMlint
is the verb..regex-patterns
.. ?regex-validation
🙂bitter-ability-32190
01/14/2022, 7:35 PMhundreds-father-404
01/14/2022, 7:36 PMIsn't the fact that it uses a regex just an implementation detail?I don't think so because you provide the regexes yourself. This is Pants's config for what is currently the
validate
goal:
path_patterns:
- name: python_source
pattern: (?<!__init__)\.py$
- name: rust_source
pattern: .*.rs$
- name: build_files
pattern: /BUILD(?:\..*)?$
content_patterns:
- name: python_header
pattern: |+
^(?:#\!\/usr\/bin\/env python3
)?# Copyright 20\d\d Pants project contributors \(see CONTRIBUTORS.md\)\.
# Licensed under the Apache License, Version 2.0 \(see LICENSE\)\.
- name: rust_header
pattern: |+
^// Copyright 20\d\d Pants project contributors \(see CONTRIBUTORS.md\)\.
// Licensed under the Apache License, Version 2.0 \(see LICENSE\)\.
required_matches:
python_source:
- python_header
# TODO: Make rust code conform, then uncomment this.
# rust_source:
# - rust_header
build_files:
- python_header
happy-kitchen-89482
01/14/2022, 7:41 PMrelint
?curved-television-6568
01/14/2022, 7:41 PMhundreds-father-404
01/14/2022, 7:43 PMalternative-to-regex-validator
or so on. I suspect it would be cleaner to keep them separate. (And that's part of my motivation for merging validate
goal into just one of many lint
implementations)regex-lint
or regex-linter
? I don't love the ambiguity of what "re" meansregex-linter
> regex-validator
, given that it's the lint
goal 😉bitter-ability-32190
01/14/2022, 7:44 PMimport re
Also, since we're bikeshedding regex-linter
looks like it lints regexescurved-television-6568
01/14/2022, 7:50 PMlint-patterns
?bitter-ability-32190
01/14/2022, 7:52 PMfile-contents-pattern-matcher
really just eat those columns uphappy-kitchen-89482
01/14/2022, 7:52 PMregex-lint
?pattern-matcher
?bitter-ability-32190
01/14/2022, 7:57 PMfilestamp
if you want to just use a more nebulus namehundreds-father-404
01/14/2022, 8:05 PMregex-lint
also sound like it's linting regex? I see why regex-linter
sounds like that, but this feels different to mebitter-ability-32190
01/14/2022, 8:05 PMcurved-television-6568
01/14/2022, 8:10 PMregex-lint
worksbitter-ability-32190
01/14/2022, 8:11 PMregex-filelint
some part of me itches for file
hundreds-father-404
01/14/2022, 8:13 PMfile
vs what, directories?
I think regex-lint
seems to work well. Thanks all for participating in the bike shed of the week 😅curved-television-6568
01/14/2022, 8:14 PMThat makes me wonderI think vs “regex’es”.. makes it very clear it is not regex patterns being linted..vs what, directories?file
regex-filelinter
would work too.. (I prefer regex-lint
though, it is more succinct)