Skip to content
Snippets Groups Projects
Commit 4ab3c150 authored by joel.vonderwe's avatar joel.vonderwe Committed by michael.minelli
Browse files

Add sonar language utilities

parent 82c7b8e1
No related branches found
No related tags found
No related merge requests found
import axios from 'axios';
import https from 'https';
import SharedConfig from '../config/SharedConfig';
import { Language } from '@prisma/client';
class SharedSonarManager {
......@@ -22,6 +23,22 @@ class SharedSonarManager {
return false;
}
}
/**
* Map a language name to the equivalent language ID in Sonar
* Most language have the same name, so by default the same name is returned, even for languages that doesn't exist in sonar.
* @param language
*/
mapLanguage(language: Language): string {
switch (language) {
case Language.csharp:
return "cs";
case Language.python:
return "py";
default:
return language;
}
}
}
export default new SharedSonarManager();
\ No newline at end of file
enum SonarRoute {
SET_PAT = '/api/alm_integrations/set_pat',
PROJECT_CREATE_GITLAB = '/api/alm_integrations/import_gitlab_project'
PROJECT_CREATE_GITLAB = '/api/alm_integrations/import_gitlab_project',
GET_LANGUAGES = '/api/languages/list'
}
export default SonarRoute;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment