Use the prefix id for keying into metrics rules
Fixes a bug where we were looking for incorrect keys for metrics rules. Previously, we were using full language names in the keys. Now, we use the short language names in the metric ids. This is done through a simplification of the code. Also, this change does two smaller things: 1. Prints out the baseline count to the logs 2. Adds the `assertNever` function to ensure we never miss a case in a switch statement. This function is borrowed from vscode-codeql.
This commit is contained in:
parent
4c0671c518
commit
e8b2a9884b
15 changed files with 168 additions and 116 deletions
|
|
@ -20,7 +20,7 @@ test("ensure lines of code works for cpp and js", async (t) => {
|
|||
|
||||
t.deepEqual(results, {
|
||||
cpp: 6,
|
||||
js: 3,
|
||||
javascript: 3,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -34,8 +34,8 @@ test("ensure lines of code can handle undefined language", async (t) => {
|
|||
);
|
||||
|
||||
t.deepEqual(results, {
|
||||
js: 3,
|
||||
py: 5,
|
||||
javascript: 3,
|
||||
python: 5,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ test("ensure lines of code can handle includes", async (t) => {
|
|||
);
|
||||
|
||||
t.deepEqual(results, {
|
||||
js: 15,
|
||||
javascript: 15,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -77,6 +77,6 @@ test("ensure lines of code can handle exclude", async (t) => {
|
|||
);
|
||||
|
||||
t.deepEqual(results, {
|
||||
js: 3,
|
||||
javascript: 3,
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue