Skip to content

Commit 0f77a14

Browse files
authored
Merge pull request #12 from Webperf-se/category-standard
Added category property to issue object
2 parents 92e2393 + 697467a commit 0f77a14

5 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/update-stylelint-rules.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ jobs:
5757
- rule name include 'no-important'
5858
5959
Following files may be touched:
60-
- configurations/css-stylelint-standard.json
60+
- configurations/standard.json
6161
assignees: 7h3Rabbit,cockroacher,marcusosterberg
6262
reviewers: 7h3Rabbit,cockroacher,marcusosterberg
6363
add-paths: |
64-
configurations/css-stylelint-standard.json
65-
configurations/css-stylelint-standard-sv.json
64+
configurations/standard.json
65+
configurations/standard-sv.json
File renamed without changes.
File renamed without changes.

lib/harAnalyzer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class HarAnalyzer {
1111
// Read and parse the configuration file
1212
const libFolder = fileURLToPath(new URL('..', import.meta.url));
1313
this.pluginFolder = path.resolve(libFolder, '..');
14-
const configPath = path.resolve(libFolder, 'configurations', 'css-stylelint-standard.json');
14+
const configPath = path.resolve(libFolder, 'configurations', 'standard.json');
1515
this.config = JSON.parse(readFileSync(configPath, 'utf8'));
1616
}
1717

@@ -117,6 +117,7 @@ export class HarAnalyzer {
117117
res.warnings.map(warning => ({
118118
url: entry.url,
119119
rule: warning.rule,
120+
category: 'standard',
120121
severity: warning.severity,
121122
text: warning.text,
122123
line: warning.line,

tools/update_stylelint.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def replacer(match):
1515

1616

1717
def update_stylelint_rules():
18-
print('updates rules used in configurations/css-stylelint-standard.json')
18+
print('updates rules used in configurations/standard.json')
1919

2020
base_directory = Path(os.path.dirname(
2121
os.path.realpath(__file__)) + os.path.sep).parent
@@ -53,7 +53,7 @@ def update_stylelint_rules():
5353
# Sort the rules dictionary by key
5454
rules = dict(sorted(rules.items()))
5555

56-
stylelint_standard_path = os.path.join(base_directory, 'configurations', 'css-stylelint-standard.json')
56+
stylelint_standard_path = os.path.join(base_directory, 'configurations', 'standard.json')
5757
with open(stylelint_standard_path, 'w', encoding='utf-8') as outfile:
5858
json.dump({
5959
'description': f'This file is automatically generated. Do not edit this file. Instead update tools/update_stylelint.py.',
@@ -66,7 +66,7 @@ def update_stylelint_rules():
6666
# if language_code in ('en', 'gov'):
6767
# continue
6868

69-
# print(f'updates rules used in configurations/css-stylelint-standard-{language_code}.json')
69+
# print(f'updates rules used in configurations/standard-{language_code}.json')
7070

7171
# language_rules = rules.copy()
7272
# language = gettext.translation(
@@ -79,7 +79,7 @@ def update_stylelint_rules():
7979

8080
# rule_items[1]['message'] = language.gettext(msg_id)
8181

82-
# stylelint_standard_path = os.path.join(base_directory, 'configurations', f'css-stylelint-standard-{language_code}.json')
82+
# stylelint_standard_path = os.path.join(base_directory, 'configurations', f'standard-{language_code}.json')
8383
# with open(stylelint_standard_path, 'w', encoding='utf-8') as outfile:
8484
# json.dump({
8585
# 'description': f'This file is automatically generated. Do not edit this file. Instead update the translation file locales/{language_code}/css_linting.po.',

0 commit comments

Comments
 (0)