Compare commits
1 Commits
v1.28.0
...
fix/issues
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
415b1c7091 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,3 +5,5 @@ __pycache__
|
|||||||
/yamllint.egg-info
|
/yamllint.egg-info
|
||||||
/build
|
/build
|
||||||
/.eggs
|
/.eggs
|
||||||
|
*.yaml
|
||||||
|
!*.yaml/
|
||||||
|
|||||||
@@ -2,8 +2,11 @@
|
|||||||
|
|
||||||
yaml-files:
|
yaml-files:
|
||||||
- '*.yaml'
|
- '*.yaml'
|
||||||
|
- '!*.yaml/'
|
||||||
- '*.yml'
|
- '*.yml'
|
||||||
|
- '!*.yml/'
|
||||||
- '.yamllint'
|
- '.yamllint'
|
||||||
|
- '!.yamllint/'
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
braces: enable
|
braces: enable
|
||||||
|
|||||||
@@ -32,8 +32,14 @@ class YamlLintConfig(object):
|
|||||||
|
|
||||||
self.ignore = None
|
self.ignore = None
|
||||||
|
|
||||||
self.yaml_files = pathspec.PathSpec.from_lines(
|
self.yaml_files = pathspec.PathSpec.from_lines('gitwildmatch', [
|
||||||
'gitwildmatch', ['*.yaml', '*.yml', '.yamllint'])
|
'*.yaml',
|
||||||
|
'!*.yaml/',
|
||||||
|
'*.yml',
|
||||||
|
'!*.yml/',
|
||||||
|
'.yamllint',
|
||||||
|
'!.yamllint/',
|
||||||
|
])
|
||||||
|
|
||||||
self.locale = None
|
self.locale = None
|
||||||
|
|
||||||
@@ -48,7 +54,7 @@ class YamlLintConfig(object):
|
|||||||
return self.ignore and self.ignore.match_file(filepath)
|
return self.ignore and self.ignore.match_file(filepath)
|
||||||
|
|
||||||
def is_yaml_file(self, filepath):
|
def is_yaml_file(self, filepath):
|
||||||
return self.yaml_files.match_file(os.path.basename(filepath))
|
return self.yaml_files.match_file(filepath)
|
||||||
|
|
||||||
def enabled_rules(self, filepath):
|
def enabled_rules(self, filepath):
|
||||||
return [yamllint.rules.get(id) for id, val in self.rules.items()
|
return [yamllint.rules.get(id) for id, val in self.rules.items()
|
||||||
|
|||||||
Reference in New Issue
Block a user