Skip to content

Commit

Permalink
Merge branch 'main' into aibaars-additional-packs
Browse files Browse the repository at this point in the history
  • Loading branch information
aeisenberg authored May 21, 2021
2 parents 69cc355 + 1ad5a6c commit c3e0f88
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 34 deletions.
3 changes: 2 additions & 1 deletion lib/analyze.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 22 additions & 10 deletions lib/config-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.js.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions lib/config-utils.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.test.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ export async function runQueries(
logger.startGroup(`Analyzing ${language}`);

const queries = config.queries[language];
if (queries.builtin.length === 0 && queries.custom.length === 0) {
if (
queries === undefined ||
(queries.builtin.length === 0 && queries.custom.length === 0)
) {
throw new Error(
`Unable to analyse ${language} as no queries were selected for this language`
);
Expand Down
10 changes: 8 additions & 2 deletions src/config-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ test("load empty config", async (t) => {
const codeQL = setCodeQL({
async resolveQueries() {
return {
byLanguage: {},
byLanguage: {
javascript: { queries: ["query1.ql"] },
python: { queries: ["query2.ql"] },
},
noDeclaredLanguage: {},
multipleDeclaredLanguages: {},
};
Expand Down Expand Up @@ -116,7 +119,10 @@ test("loading config saves config", async (t) => {
const codeQL = setCodeQL({
async resolveQueries() {
return {
byLanguage: {},
byLanguage: {
javascript: { queries: ["query1.ql"] },
python: { queries: ["query2.ql"] },
},
noDeclaredLanguage: {},
multipleDeclaredLanguages: {},
};
Expand Down
Loading

0 comments on commit c3e0f88

Please sign in to comment.