Skip to content

Commit

Permalink
Showing 6 changed files with 35 additions and 6 deletions.
8 changes: 8 additions & 0 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.

10 changes: 8 additions & 2 deletions src/config-utils.test.ts
@@ -224,7 +224,9 @@ test("default queries are used", async t => {
resolveQueriesArgs.push({queries, extraSearchPath});
return {
byLanguage: {
'javascript': {},
'javascript': {
'foo.ql': {},
},
},
noDeclaredLanguage: {},
multipleDeclaredLanguages: {},
@@ -262,7 +264,11 @@ test("API client used when reading remote config", async t => {
CodeQL.setCodeQL({
resolveQueries: async function() {
return {
byLanguage: {},
byLanguage: {
'javascript': {
'foo.ql': {},
},
},
noDeclaredLanguage: {},
multipleDeclaredLanguages: {},
};
9 changes: 9 additions & 0 deletions src/config-utils.ts
@@ -577,6 +577,15 @@ async function loadConfig(configFile: string): Promise<Config> {
});
}

// The list of queries should not be empty for any language. If it is then
// it is a user configuration error.
for (const language of languages) {
if (queries[language].length === 0) {
throw new Error(`Did not detect any queries to analyze for ${language}. ` +
"Please make sure that the default queries are enabled, or you are specifying queries to run.");
}
}

return {
languages,
queries,

0 comments on commit dc36689

Please sign in to comment.