Add option for ensuring specific line length#53
Merged
jvoigtlaender merged 6 commits intomasterfrom May 5, 2026
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Member
|
To the question: No. I also think it may be useful to configure „no other syntax checks than code width, and actually we have no restriction on code width“. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an optional maxLineLength configuration to reject submissions containing overlong lines, integrates that check as a distinct syntax phase (CodeWidth) that can be selected via syntaxCutoff, and introduces an optimization to skip writing any files during grading when only the CodeWidth syntax phase is run and semantics are disabled.
Changes:
- Added
maxLineLength :: Maybe Naturalto the solution config and included it in config parsing/defaulting/combination. - Introduced a new
FeedbackPhasestepCodeWidthand acheckLineLengthphase that reports all offending lines (number, content, and length). - Skipped file-writing in
gradewhensyntaxCutoff == CodeWidthanddisableSemanticsis set.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Haskell/Template/Task.hs |
Adds maxLineLength, new CodeWidth phase, line-length rejection logic, and a conditional “no file writes” grading path. |
.github/actions/spelling/expect.txt |
Whitelists linebreak for the spelling workflow due to new pretty-print usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #16
Reject if submission contains any lines with length >
maxLineLengthoptionDisplay all offending lines at once, including their location, content and total length

add this as a separate syntax phase for
syntaxCutoff(CodeWidth)Do not write any files while grading if
syntaxCutoffis set toCodeWidthanddisableSemanticsis set.Question: Should the config checker prevent setting
syntaxCutofftoCodeWidthifmaxLineLengthis unset? I wasn't sure about that, since it may still be useful to directly accept any submission without considering its content (similar to not writing files if we only check the line length).