Files
Riccardo Schirone 60b0ae35e5 Update cAPI to v1.2-rc4 and API to v1.3.0 (#740)
* Update competition-test-api to v1.2-rc4

* orchestrator: update API to v1.3.0
2025-05-29 12:05:43 +02:00
..

Project Source Language Determination

As part of evaluating a patch, Scantron has to determine if it only modifies files in the target project's language.

Scantron uses go-enry v2.9.2 to determine a file's language. This folder contains binaries so that you can run the same process outside of Scantron.

Binaries

These can be found in the dist folder.

Usage

identifier accepts a language, either java or c, and a path to a source file. It returns both a string boolean and a return code indicating whether the source file is in the specified language.

$ ./identifier --help
Identifies file type

Usage:
  identifier [flags]

Flags:
  -h, --help                help for identifier
      --language Language   "java" or "c"
      --path string         Path to file to check

$ ./identifier --language java --path ~/Source.java
true
$ echo $?
0

$ ./identifier --language c --path ~/Source.java
false
$ echo $?
1

$ ./identifier --language c --path ~/nonexistent
Error: open /home/user/nonexistent
$ echo $?
201