Skip to main content
Version: 2.8 (deprecated)

sourcefile-validation


Configuration for source file validation.

Backend: ``

Config section: [sourcefile-validation]

Basic options

config

--sourcefile-validation-config="{'key1': val1, 'key2': val2, ...}"
PANTS_SOURCEFILE_VALIDATION_CONFIG
pants.toml
[sourcefile-validation.config]
key1 = val1
key2 = val2
...
default: {}

Config schema is as follows:

{
'required_matches': {
'path_pattern1': [content_pattern1, content_pattern2],
'path_pattern2': [content_pattern1, content_pattern3],
...
},
'path_patterns': [
{
'name': path_pattern1',
'pattern': <path regex pattern>,
'inverted': True|False (defaults to False),
'content_encoding': <encoding> (defaults to utf8)
},
...
],
'content_patterns': [
{
'name': 'content_pattern1',
'pattern': <content regex pattern>,
'inverted': True|False (defaults to False)
}
...
]
}

Meaning: if a file matches some path pattern, its content must match all the corresponding content patterns.

Advanced options

None

Deprecated options

None

None