Merge pull request #159 from jayvdb/add-ng-profile

Add Angular profile
This commit is contained in:
sur.la.route 2021-12-14 10:02:54 +01:00 committed by GitHub
commit 736a03307f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -107,6 +107,7 @@ Options:
- nunjucks
- handlebars (for handlebars and mustache)
- golang
- angular
Usage:

View file

@ -195,6 +195,7 @@ class Config:
"nunjucks": ["D", "J", "M"],
"handlebars": ["D", "J", "N"],
"golang": ["D", "J", "N", "M"],
"angular": ["D", "J", "H012", "H026", "H028"],
}
self.profile_code: List[str] = profile_dict.get(
@ -220,7 +221,9 @@ class Config:
self.linter_rules = list(
filter(
lambda x: x["rule"]["name"] not in self.ignore.split(",")
and x["rule"]["name"][0] not in self.profile_code
and not any(
x["rule"]["name"].startswith(code) for code in self.profile_code
)
and self.profile not in x["rule"].get("exclude", []),
rule_set,
)

View file

@ -78,6 +78,7 @@ def no_pragma(config: Config, this_file: Path) -> bool:
"nunjucks": nunjucks_patterns + html_patterns,
"handlebars": handlebars_patterns + html_patterns,
"golang": golang_patterns + html_patterns,
"angular": html_patterns,
"all": django_jinja_patterns
+ nunjucks_patterns
+ handlebars_patterns