Skip to content

Add lint toolchain, generate the index page, and correct Legacy Code examples - #53

Closed
megabyde wants to merge 3 commits into
mainfrom
chore/refresh-slides-repository
Closed

Add lint toolchain, generate the index page, and correct Legacy Code examples#53
megabyde wants to merge 3 commits into
mainfrom
chore/refresh-slides-repository

Conversation

@megabyde

Copy link
Copy Markdown
Member

Three commits, each passing make check on its own. Review them separately; the first two are mostly mechanical and the third is the one that changes what the decks teach.

build: lint toolchain and generated index page

Adds prettier and markdownlint-cli2 behind make check, with the reformat they produce across the Legacy Code decks. Two long Exercise bullets are split and one heading is demoted from ### to ## to satisfy MD013 and MD001.

_site/index.html is no longer maintained by hand. It is built from the README Curriculum section through index.template.html and index.lua, so the tables in the README are the only place the curriculum is edited. The generated file is untracked and _site/ is ignored. The Lua filter keeps the Curriculum section, rewrites *.md#anchor deck links to .pdf, and reapplies the Bootstrap table classes; it fails the build if the Curriculum heading ever goes missing rather than publishing an empty page.

The generated page has an identical link set and row count to the previous hand-written one. Two cosmetic differences: pandoc's smart extension produces typographic quotes, matching what the beamer decks already do, and headings pick up anchor ids.

The deck glob $(wildcard **/*.md) relied on globstar, which GNU make does not implement, so it silently meant */*.md. It is now a find with -mindepth 2, which keeps README.md out and picks up decks at any depth.

ci: deploy gating and workflow permissions

Blanket workflow permissions are replaced by per-job grants, so only deploy holds pages: write and id-token: write.

build now depends on lint, so a failing make check stops the deployment on pushes to main and not only on pull requests. deploy gets a pages concurrency group so overlapping pushes cannot race. The group is job-level rather than workflow-level on purpose: this workflow also runs lint and build on pull requests, and a shared group would queue those against deployments.

npm ci with a committed lockfile replaces npm install --no-package-lock, which left transitive dependencies floating and hid them from Dependabot. actions/configure-pages is dropped: nothing consumed its outputs and page_url comes from deploy-pages.

Adds CODEOWNERS and a monthly Dependabot schedule for npm and actions.

fix: Legacy Code examples and curriculum links

  • Wrap Class demonstrated inheritance, not wrapping. LoggingEngine(Engine) subclassed the legacy class and called super(). It now holds an injected Engine and delegates. The comparison table row that described the technique as Subclass is corrected to Wrapper.
  • The sprouting kata asked for something sprouting cannot do. It said "do not modify the original method", but sprouting requires a minimal call site change. Reworded to ask for exactly that.
  • The C++ singleton compared a pointer against null. Now nullptr.
  • The invoice characterization test expected the wrong number. The calculator shown on the slide returns 2132.10 for the listed line items (500, then 1368, then 2132.1), not 1850.95.
  • The tax characterization test was a tautology. It computed expected values from the same calculator it then asserted against, so it passed regardless of behaviour. It now records the six expected outputs directly.
  • Two curriculum links. The Advanced TDD C++ Mars Rover link pointed at the Python repository, and the SOLID foundations worksheet was rendered to a PDF but not reachable from either the README or the site.

Not included

Actions are pinned to tags rather than commit SHAs, and the site still loads Bootstrap 3.3.7 from a CDN with SRI intact. Both are deliberate, and neither is a change I would fold into this branch.

Add prettier and markdownlint-cli2 behind `make check`, plus the reformat
and the two long-line and heading-level fixes they require in the Legacy
Code decks.

Build `_site/index.html` from the README curriculum through a pandoc
template and Lua filter instead of maintaining a second copy by hand, and
stop tracking the generated output.

Replace the `**/*.md` deck glob, which relies on globstar that GNU make
does not implement, with a find that keeps decks at any depth.
Drop the blanket workflow permissions in favour of per-job grants, so only
the deploy job holds `pages: write` and `id-token: write`.

Run `make check` as a job that build depends on, so a lint failure stops
the deployment on pushes to main and not only on pull requests. Serialize
the deploy job on a `pages` concurrency group to stop overlapping pushes
racing each other.

Add CODEOWNERS and a monthly Dependabot schedule for npm and actions.
Wrap Class demonstrated inheritance rather than wrapping. Hold the legacy
Engine in the wrapper and delegate to it, and correct the comparison table
row that described the technique as subclassing.

The sprouting kata told readers not to modify the original method, which
sprouting cannot satisfy; ask for the minimal call site change instead.

The C++ singleton compared a pointer against `null`. The invoice
characterization test expected 1850.95 where the shown calculator returns
2132.10. The tax characterization test asserted against values it had just
computed from the same calculator, which passes whatever the behaviour is;
record the expected outputs instead.

Point the Advanced TDD C++ Mars Rover link at the C++ repository, and link
the SOLID foundations worksheet, which was rendered but unreachable.
@megabyde

Copy link
Copy Markdown
Member Author

Superseded by three stacked PRs, one per commit, so the course-content corrections can be reviewed on their own rather than alongside the tooling:

Same commits, same final tree. Merge in order; GitHub retargets each to main as its base merges.

@megabyde megabyde closed this Aug 16, 2026
@megabyde
megabyde deleted the chore/refresh-slides-repository branch August 17, 2026 05:30
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