getgrit / gritql

GritQL is a query language for searching, linting, and modifying code.
https://docs.grit.io/
MIT License
3.03k stars 71 forks source link

Find patterns elsewhere in directory tree #392

Open morgante opened 3 months ago

morgante commented 3 months ago

Sometimes we would like to pull in patterns (especially test patterns) from other documentation.

For example, Terraform modules like this must store docs in a docs/guides directory according to Hashicorp.

Right now we require all testable patterns to be found in .grit/patterns but we should consider pulling them in from elsewhere.

morgante commented 3 months ago

It's probably sufficient to add a pattern_files array in .grit/grit.yaml to list additional files in the repo that should be parsed as testable patterns.

For example:

version: 0.2.0
patterns: []
pattern_files:
- docs/guides/version-5-upgrade.md
morgante commented 2 months ago

https://github.com/getgrit/gritql/pull/398