GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix auto-detection of extractors that aren't languages · github/codeql-action@5794ffc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • config-utils.js.map
    • config-utils.js
    • config-utils.test.js.map
    • config-utils.test.js
    • languages.js.map
    • languages.js
  • src
    • config-utils.test.ts
    • config-utils.ts
    • languages.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/config-utils.js‎

Copy file name to clipboardExpand all lines: lib/config-utils.js
+7-1Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎lib/config-utils.js.map‎

Copy file name to clipboardExpand all lines: lib/config-utils.js.map
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎lib/config-utils.test.js‎

Copy file name to clipboardExpand all lines: lib/config-utils.test.js
+15Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎lib/config-utils.test.js.map‎

Copy file name to clipboardExpand all lines: lib/config-utils.test.js.map
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎lib/languages.js‎

Copy file name to clipboardExpand all lines: lib/languages.js
+2-1Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎lib/languages.js.map‎

Copy file name to clipboardExpand all lines: lib/languages.js.map
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎src/config-utils.test.ts‎

Copy file name to clipboardExpand all lines: src/config-utils.test.ts
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function createTestInitConfigInputs(
6363
async betterResolveLanguages() {
6464
return {
6565
extractors: {
66+
html: [{ extractor_root: "" }],
6667
javascript: [{ extractor_root: "" }],
6768
},
6869
};
@@ -1125,6 +1126,20 @@ const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
11251126
expectedApiCall: false,
11261127
expectedError: configUtils.getUnknownLanguagesError(["a", "b"]),
11271128
},
1129+
{
1130+
name: "extractors that aren't languages aren't included (specified)",
1131+
languagesInput: "html",
1132+
languagesInRepository: [],
1133+
expectedApiCall: false,
1134+
expectedError: configUtils.getUnknownLanguagesError(["html"]),
1135+
},
1136+
{
1137+
name: "extractors that aren't languages aren't included (autodetected)",
1138+
languagesInput: "",
1139+
languagesInRepository: ["html", "javascript"],
1140+
expectedApiCall: true,
1141+
expectedLanguages: ["javascript"],
1142+
},
11281143
].forEach((args) => {
11291144
test(`getLanguages: ${args.name}`, async (t) => {
11301145
const mockRequest = mockLanguagesInRepo(args.languagesInRepository);
Collapse file

‎src/config-utils.ts‎

Copy file name to clipboardExpand all lines: src/config-utils.ts
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,13 @@ export async function getSupportedLanguageMap(
310310
const supportedLanguages: Record<string, string> = {};
311311
// Populate canonical language names
312312
for (const extractor of Object.keys(resolveResult.extractors)) {
313-
supportedLanguages[extractor] = extractor;
313+
// Require the language to be a known language.
314+
// This is a temporary workaround since we have extractors that are not
315+
// supported languages, such as `csv`, `html`, `properties`, `xml`, and
316+
// `yaml`. We should replace this with a more robust solution in the future.
317+
if (KnownLanguage[extractor] !== undefined) {
318+
supportedLanguages[extractor] = extractor;
319+
}
314320
}
315321
// Populate language aliases
316322
if (resolveResult.aliases) {
Collapse file

‎src/languages.ts‎

Copy file name to clipboardExpand all lines: src/languages.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ export type Language = string;
88
* languages do not need to be added here.
99
*/
1010
export enum KnownLanguage {
11-
csharp = "csharp",
11+
actions = "actions",
1212
cpp = "cpp",
13+
csharp = "csharp",
1314
go = "go",
1415
java = "java",
1516
javascript = "javascript",

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.