Skip to content

Commit e96eaba

Browse files
Generate linted .ts in package (#49)
* Generate linted .ts in package * (Lin|ni)t changes Co-authored-by: Justin Ibarra <brokensound77@users.noreply.github.com>
1 parent c28795c commit e96eaba

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

NOTICE.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Copyright 2020 Elasticsearch B.V.
55
This product bundles rules based on https://github.com/BlueTeamLabs/sentinel-attack
66
which is available under a "MIT" license. The files based on this license are:
77

8-
- defense_evasion_via_filter_manager.toml
9-
- discovery_process_discovery_via_tasklist_command.toml
10-
- persistence_priv_escalation_via_accessibility_features.toml
11-
- persistence_via_application_shimming.toml
12-
- defense_evasion_execution_via_trusted_developer_utilities.toml
8+
- defense_evasion_via_filter_manager
9+
- discovery_process_discovery_via_tasklist_command
10+
- persistence_priv_escalation_via_accessibility_features
11+
- persistence_via_application_shimming
12+
- defense_evasion_execution_via_trusted_developer_utilities
1313

1414
MIT License
1515

detection_rules/packaging.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def _package_notice_file(save_dir):
131131
notice_txt = f.read()
132132

133133
with open(os.path.join(save_dir, 'notice.ts'), 'wt') as f:
134-
commented_notice = [' * ' + line for line in notice_txt.splitlines()]
134+
commented_notice = [f' * {line}'.rstrip() for line in notice_txt.splitlines()]
135135
lines = ['/* eslint-disable @kbn/eslint/require-license-header */', '', '/* @notice']
136136
lines = lines + commented_notice + [' */', '']
137137
f.write('\n'.join(lines))
@@ -150,14 +150,15 @@ def _package_index_file(self, save_dir):
150150
const_exports = ['export const rawRules = [']
151151
const_exports.extend(f" rule{i}," for i, _ in enumerate(sorted_rules, 1))
152152
const_exports.append("];")
153-
const_exports.append(" ")
153+
const_exports.append("")
154154

155155
index_ts = [JS_LICENSE, ""]
156156
index_ts.extend(comments)
157157
index_ts.append("")
158158
index_ts.extend(rule_imports)
159159
index_ts.append("")
160160
index_ts.extend(const_exports)
161+
161162
with open(os.path.join(save_dir, 'index.ts'), 'wt') as f:
162163
f.write('\n'.join(index_ts))
163164

0 commit comments

Comments
 (0)