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

Support columns in annotations and expose path merging algorithm #167

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Luro02
Copy link
Collaborator

@Luro02 Luro02 commented Jan 29, 2025

Artemis seems to only support annotating an entire line. For grading, it is useful to support highlighting parts of a line.

For example, given this code and two annotations:

int three = 3;
//  ^ bad identifier
//          ^ magic number

intelligrade would highlight everything in that line, even though it could just highlight the identifier and the magic number. The autograder already exposes the column information.

This PR closes #158.

In addition to that, it closes #163.

The formatting of paths

I implemented this code in multiple codebases now, mainly intelligrade and this library share similar code. That is why I decided to write a more refined version in artemis4j that can then be used in intelligrade as well.

After about 20 hours of work later, we end up with the code in this pull request. Here are some things I am not happy with yet, but not sure what to do instead:

  • The names of the classes might be confusing
  • is a utils package a good location? Where should those classes be?
  • I don't like the name of LocationMergingPathFormatter
  • Implementation of LocationMergingPathFormatter class is questionable. I think it should work correctly, but I am not sure

As a side-note: Lines are 0-indexed and not 1-indexed. That is so confusing, and nobody even noticed that the annotation merging code assumed they were 1-indexed. The bug is now fixed, but this should be checked in intelligrade.

@Luro02
Copy link
Collaborator Author

Luro02 commented Jan 29, 2025

image
Regarding that, not possible. Spotless breaks when you use that.

@kit-sdq kit-sdq deleted a comment from sonarqubecloud bot Feb 2, 2025
@Luro02 Luro02 marked this pull request as ready for review February 2, 2025 14:19
@Luro02 Luro02 requested a review from a team as a code owner February 2, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
1 participant