Skip to content

Commit

Permalink
Sort lists of programming languages
Browse files Browse the repository at this point in the history
This should reduce merge conflicts by reducing changes to adjacent lines
  • Loading branch information
magaupp committed Oct 8, 2024
1 parent ae3fec1 commit d7d46a1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ dependencies {
implementation "org.gitlab4j:gitlab4j-api:6.0.0-rc.5"

implementation "de.jplag:jplag:${jplag_version}"

implementation "de.jplag:c:${jplag_version}"
implementation "de.jplag:java:${jplag_version}"
implementation "de.jplag:javascript:${jplag_version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,13 @@ public void deleteTempLocalRepository(Repository repository) {

private Language getJPlagProgrammingLanguage(ProgrammingExercise programmingExercise) {
return switch (programmingExercise.getProgrammingLanguage()) {
case JAVA -> new JavaLanguage();
case C -> new CLanguage();
case PYTHON -> new PythonLanguage();
case SWIFT -> new SwiftLanguage();
case JAVA -> new JavaLanguage();
case JAVASCRIPT -> new JavaScriptLanguage();
case KOTLIN -> new KotlinLanguage();
case PYTHON -> new PythonLanguage();
case RUST -> new RustLanguage();
case JAVASCRIPT -> new JavaScriptLanguage();
case SWIFT -> new SwiftLanguage();
case TYPESCRIPT -> new TypeScriptLanguage();
case EMPTY, PHP, DART, HASKELL, ASSEMBLER, OCAML, C_SHARP, C_PLUS_PLUS, SQL, R, GO, MATLAB, BASH, VHDL, RUBY, POWERSHELL, ADA -> throw new BadRequestAlertException(
"Programming language " + programmingExercise.getProgrammingLanguage() + " not supported for plagiarism check.", "ProgrammingExercise", "notSupported");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ public enum ProgrammingLanguage {
PHP("php");

private static final Set<ProgrammingLanguage> ENABLED_LANGUAGES = Set.of(
JAVA,
PYTHON,
ASSEMBLER,
C,
HASKELL,
JAVA,
JAVASCRIPT,
KOTLIN,
VHDL,
ASSEMBLER,
SWIFT,
OCAML,
PYTHON,
RUST,
JAVASCRIPT,
SWIFT,
TYPESCRIPT,
VHDL,
EMPTY
);
// @formatter:on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class GitLabCIProgrammingLanguageFeatureService extends ProgrammingLangua
public GitLabCIProgrammingLanguageFeatureService() {
programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false, false));
programmingLanguageFeatures.put(JAVA, new ProgrammingLanguageFeature(JAVA, false, false, false, true, false, List.of(PLAIN_MAVEN, MAVEN_MAVEN), false, false));
programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false, false));
programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false, false));
programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false, false));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ public class JenkinsProgrammingLanguageFeatureService extends ProgrammingLanguag
public JenkinsProgrammingLanguageFeatureService() {
// Must be extended once a new programming language is added
programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false, false));
programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, false, true, false, false, List.of(FACT, GCC), false, false));
programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, false, false, false, false, true, List.of(), false, false));
programmingLanguageFeatures.put(JAVA,
new ProgrammingLanguageFeature(JAVA, true, true, true, true, false, List.of(PLAIN_GRADLE, GRADLE_GRADLE, PLAIN_MAVEN, MAVEN_MAVEN, MAVEN_BLACKBOX), true, false));
programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false, false));
programmingLanguageFeatures.put(KOTLIN, new ProgrammingLanguageFeature(KOTLIN, true, false, true, true, false, List.of(), true, false));
programmingLanguageFeatures.put(PYTHON, new ProgrammingLanguageFeature(PYTHON, false, false, true, false, false, List.of(), false, false));
programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false, false));
// Jenkins is not supporting XCODE at the moment
programmingLanguageFeatures.put(SWIFT, new ProgrammingLanguageFeature(SWIFT, false, true, true, true, false, List.of(PLAIN), false, false));
programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, false, true, false, false, List.of(FACT, GCC), false, false));
programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, false, false, false, false, true, List.of(), false, false));
programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false, false));
programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false, false));
programmingLanguageFeatures.put(TYPESCRIPT, new ProgrammingLanguageFeature(TYPESCRIPT, false, false, true, false, false, List.of(), false, false));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ public class LocalCIProgrammingLanguageFeatureService extends ProgrammingLanguag
public LocalCIProgrammingLanguageFeatureService() {
// Must be extended once a new programming language is added
programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false, true));
programmingLanguageFeatures.put(ASSEMBLER, new ProgrammingLanguageFeature(ASSEMBLER, false, false, false, false, false, List.of(), false, true));
programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, true, true, false, false, List.of(FACT, GCC), false, true));
programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, true, false, false, false, true, List.of(), false, true));
programmingLanguageFeatures.put(JAVA,
new ProgrammingLanguageFeature(JAVA, true, true, true, true, false, List.of(PLAIN_GRADLE, GRADLE_GRADLE, PLAIN_MAVEN, MAVEN_MAVEN), false, true));
programmingLanguageFeatures.put(PYTHON, new ProgrammingLanguageFeature(PYTHON, false, false, true, false, false, List.of(), false, true));
programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, true, true, false, false, List.of(FACT, GCC), false, true));
programmingLanguageFeatures.put(ASSEMBLER, new ProgrammingLanguageFeature(ASSEMBLER, false, false, false, false, false, List.of(), false, true));
programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false, true));
programmingLanguageFeatures.put(KOTLIN, new ProgrammingLanguageFeature(KOTLIN, false, false, true, true, false, List.of(), false, true));
programmingLanguageFeatures.put(VHDL, new ProgrammingLanguageFeature(VHDL, false, false, false, false, false, List.of(), false, true));
programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, true, false, false, false, true, List.of(), false, true));
programmingLanguageFeatures.put(OCAML, new ProgrammingLanguageFeature(OCAML, false, false, false, false, true, List.of(), false, true));
programmingLanguageFeatures.put(SWIFT, new ProgrammingLanguageFeature(SWIFT, false, false, true, true, false, List.of(PLAIN), false, true));
programmingLanguageFeatures.put(PYTHON, new ProgrammingLanguageFeature(PYTHON, false, false, true, false, false, List.of(), false, true));
programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false, true));
programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false, true));
programmingLanguageFeatures.put(SWIFT, new ProgrammingLanguageFeature(SWIFT, false, false, true, true, false, List.of(PLAIN), false, true));
programmingLanguageFeatures.put(TYPESCRIPT, new ProgrammingLanguageFeature(TYPESCRIPT, false, false, true, false, false, List.of(), false, true));
programmingLanguageFeatures.put(VHDL, new ProgrammingLanguageFeature(VHDL, false, false, false, false, false, List.of(), false, true));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ import { SubmissionPolicy } from 'app/entities/submission-policy.model';
import dayjs from 'dayjs/esm';

export enum ProgrammingLanguage {
JAVA = 'JAVA',
PYTHON = 'PYTHON',
EMPTY = 'EMPTY',
ASSEMBLER = 'ASSEMBLER',
C = 'C',
HASKELL = 'HASKELL',
JAVA = 'JAVA',
JAVASCRIPT = 'JAVASCRIPT',
KOTLIN = 'KOTLIN',
VHDL = 'VHDL',
ASSEMBLER = 'ASSEMBLER',
SWIFT = 'SWIFT',
OCAML = 'OCAML',
EMPTY = 'EMPTY',
PYTHON = 'PYTHON',
RUST = 'RUST',
JAVASCRIPT = 'JAVASCRIPT',
SWIFT = 'SWIFT',
TYPESCRIPT = 'TYPESCRIPT',
VHDL = 'VHDL',
}

export enum ProjectType {
Expand Down

0 comments on commit d7d46a1

Please sign in to comment.