Skip to content

Commit

Permalink
Merge pull request #705 from jplag/enable-rust
Browse files Browse the repository at this point in the history
Fix Rust language frontend not being detected by CLI
  • Loading branch information
tsaglam authored Sep 29, 2022
2 parents 0a088f6 + 8eb25de commit 3db7536
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ named arguments:
-h, --help show this help message and exit
-new NEW [NEW ...] Root-directory with submissions to check for plagiarism (same as the root directory)
-old OLD [OLD ...] Root-directory with prior submissions to compare against
-l {cpp,csharp,emf,go,java,kotlin,python3,rlang,scala,scheme,swift,text}
-l {cpp,csharp,emf,go,java,kotlin,python3,rlang,rust,scala,scheme,swift,text}
Select the language to parse the submissions (default: java)
-bc BC Path of the directory containing the base code (common framework used in all
submissions)
Expand Down
2 changes: 1 addition & 1 deletion cli/src/test/java/de/jplag/cli/LanguageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void testInvalidLanguage() throws Exception {
@Test
void testLoading() {
var languages = LanguageLoader.getAllAvailableLanguages();
Assertions.assertEquals(12, languages.size(), "Loaded Languages: " + languages.keySet());
Assertions.assertEquals(13, languages.size(), "Loaded Languages: " + languages.keySet());
}

@Test
Expand Down
6 changes: 6 additions & 0 deletions languages/rust/src/main/java/de/jplag/rust/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
import java.util.List;
import java.util.Set;

import org.kohsuke.MetaInfServices;

import de.jplag.ParsingException;
import de.jplag.Token;

/**
* This represents the Rust language as a language supported by JPlag.
*/
@MetaInfServices(de.jplag.Language.class)
public class Language implements de.jplag.Language {

protected static final String[] FILE_EXTENSIONS = {".rs"};
Expand Down

0 comments on commit 3db7536

Please sign in to comment.