Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom ClassTransformer order #57

Merged
merged 3 commits into from
Feb 27, 2022
Merged

Conversation

alexstaeding
Copy link
Member

Sometimes, it is useful to provide transformations that are run before submission verification. For example, it is possible that submissions have a legitimate use for System.exit, which should not disqualify the submission from being graded.

While submissions with illegal instructions (such as System.exit) should be eliminated by the end of the compilation/transformation phase, it should be possible to transform these illegal instructions to prevent submissions that would otherwise be thrown out, to be graded.

This PR adds a new enum ClassTransformerOrder and a new overload to RubricConfiguration, namely addTransformer(ClassTransformer, ClassTransformerOrder). Currently, the two values for the order are DEFAULTandPRE` (more may be added later).

Transformers registered under PRE will be run before submission verification, and all transformers registered under DEFAULT will run after all of Jagr's own transformers.

The scope of this PR is mostly a minor change (addition) with only a usually unused method being incompatibly changed.

Breaking API change: RubricConfiguration.getTransformers returns Map<ClassTransformerOrder, List<ClassTransformer>> instead of List<ClassTransformer>.

@alexstaeding alexstaeding added the semver:major A major change breaking backwards compatibility label Feb 20, 2022
@alexstaeding alexstaeding added this to the v0.4 milestone Feb 20, 2022
@alexstaeding alexstaeding merged commit 3624235 into master Feb 27, 2022
@alexstaeding alexstaeding deleted the feature/transformer-order branch February 27, 2022 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:major A major change breaking backwards compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant