Skip to content

Conversation

@mao-sz
Copy link
Contributor

@mao-sz mao-sz commented Nov 12, 2025

Because

See #30385 for more details about the current Additional Resources initiative.
Making the section optional in the TOP004 lint rule will pave the way for empty AR sections to be removed entirely, and allow the team to start evaluating existing ARs and decide on a plan of action.

Lint errors flagged are intentional as part of the relevant test files (please check the errors are what would be expected).

This PR

  • Refactors TOP004 for readability
    • Our use case and scope are limited. There was a lot of unnecessary abstraction from helper code from the library source.
    • Tweaks conditionals for reduced nesting and clearer semantics.
    • Adds comments explaining purpose of various blocks.
    • '?' syntax used for optional AR - should be easy to handle dropping or otherwise changing the intent of the AR section in the future.
  • Amends TOP004 test files
    • Fixes non-TOP004 errors
    • Accounts for undesired sections (e.g. post-assignment panel sections in projects)
  • Removes logic for empty Additional Resources from TOP003
  • Amends TOP004 docs and layout style guide to account for new optional AR section intent

Issue

Related to #30385
Closes #30386

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

Removed several helper "addError" functions - unnecessary abstractions
for our limited use case (more useful for library source code covering many more rules).

Some conditions restructured to reduce nesting noise.

More refactoring could be done but for now, not particularly
significant, and this should already be much easier to parse and
maintain.
No strong reason to allow separate post-assignment sections since they
should be workable prior to or within the assignment.

Headings within an assignment panel must be level 4 since the assignment
heading is level 3.
Fixed non-TOP004 lint errors.
Ensured all sections and headings reflect desired structures in
lessons/projects (e.g. remove any full sections after the assignment in
projects)
Additional resources will be optional - "?" feature needs demonstrating
Hopefully the refactored final missing headings conditional is a little
less unwieldy for now.
Empty AR section no longer allowed - section should not exist if empty.
TOP003 valid test added, which also demonstrates no errors if AR section
is missing.
@github-actions github-actions bot added the Content: Markdownlint Involves anything related to the curriculum repo linter label Nov 12, 2025
@mao-sz mao-sz changed the title RTop004 ar optional TOP003/004: Make Additional Resources section optional Nov 12, 2025
@ManonLef
Copy link
Member

Hi @mao-sz , I've requested a review from Eric since I believe he's well versed in our linter setup too. I think I saw you discussing this change with Carlos too however, so feel free to add him to the review list if you believe that's valuable.

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

Labels

Content: Markdownlint Involves anything related to the curriculum repo linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TOP003/004: Make Additional Resources section optional

2 participants