Skip to content

Minor model polish - NewType for absolute vs. relative paths, and narrowing program types - #487

Open
gkreitz wants to merge 2 commits into
Kattis:masterfrom
gkreitz:minor_model_polish
Open

Minor model polish - NewType for absolute vs. relative paths, and narrowing program types#487
gkreitz wants to merge 2 commits into
Kattis:masterfrom
gkreitz:minor_model_polish

Conversation

@gkreitz

@gkreitz gkreitz commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Minor polish to our model classes. This is mainly for the sake of Kattis, but also in case others want to use model as a (still somewhat unstable) API.

  • Path in model is now AbsolutePath or RelativePath to clearly communicate which paths are absolute, and which are relative. For relative paths, you can figure out what they're relative to by looking at comments.
  • For tools external API users are likely to want (grader, output validator), we now have a narrower type SourceCode | BuildRun, instead of the base class Program.

Also fixes a documentation mistake, where a path was claimed to be relative, but no longer was (which influenced my choice to actually leverage the type system to communicate this, instead of just comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant