Skip to content
Snippets Groups Projects
Commit 7f368ef9 authored by joel.vonderwe's avatar joel.vonderwe
Browse files

Add sonar language utilities

parent f520ab1b
Branches
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