Add linting - #14
Merged
Merged
Add linting#14
Conversation
Contributor
|
- .pre-commit-config.yaml: hygiene checks, codespell, markdownlint-cli2 (pinned; local node hook), and a 72-char pane-width check for the refactoring samples (pages/refactorings/*.scala|.hs). - .markdownlint-cli2.yaml: shared markdown style (80-col prose, tables and headings exempt, compact pipe style allowed). - scripts/check-sample-width.sh: enforces the sample width rule the refactoring skill already documents (LESSONS.md 'pane width'). - .github/workflows/lint.yml: runs the same pre-commit config on every PR and push to master, so local and CI can't drift. - Fixes the pre-existing issues the new rules surface: a duplicated H1 and trailing-punctuation headings in the Refactorings post, trailing whitespace, long prose lines in about/libraries/README, a folded header_subtitle scalar, and a 'Vist' typo (Visit).
Same checks, Ruby toolchain: - .overcommit.yml + .git-hooks/pre_commit/*.rb: hygiene checks (trailing whitespace, final newline, YAML/JSON syntax, merge markers, case conflicts, executable/shebang consistency), codespell, mdl (markdownlint), and the 72-char pane-width check for refactoring samples. - .mdlrc + mdl_style.rb: mdl config (front-matter, git-recurse, MD013 80-col prose, MD029 ordered, MD026 punctuation like markdownlint). - scripts/lint.sh = bundle exec overcommit --run; CI runs it, so local and CI can't drift. Gemfile dev group: overcommit + mdl. - Removes .pre-commit-config.yaml, .markdownlint-cli2.yaml, scripts/check-sample-width.sh. - Wraps a few long prose lines for the 80-col rule.
- Gemfile: add spellr (~> 0.12). - .git-hooks/pre_commit/spellr.rb: overcommit hook running bundle exec spellr on the committed files. - .spellr.yml + .spellr_wordlists/english.txt: config and site wordlist. - .overcommit.yml: Codespell -> Spellr hook. - .github/workflows/lint.yml: drop the pip codespell install (everything is now Ruby/bundler). - scripts/lint.sh: export OVERCOMMIT_NO_VERIFY for fresh checkouts (CI). - README: document spellr + wordlist.
The rebase onto master (Refactoring Section #12) brought in the refactorings catalogue, its raw-HTML citation blocks, and the internal .claude/skills/refactoring-entry docs. Tune the lint config for what is site content vs. tooling: - mdl_style.rb: allow inline HTML (MD033) — the refactorings citations are raw-HTML <li> lines by design (kramdown won't process markdown inside raw block HTML). - .overcommit.yml Mdl: exclude pages/refactorings/**/* (same reason; unwrappable citation lines), pages/refactorings.md, and .claude/**/* (agent-internal docs, not site prose). Overcommit excludes use File.fnmatch, so '**' needs the trailing '/*'. - .git-hooks/pre_commit/spellr.rb: also skip .claude/, refactorings, scala/hs/js, run.sh, and dotfiles when overcommit passes absolute paths; spellr only honors .spellr.yml excludes when given no files. - .spellr.yml + wordlist: exclude the same non-prose trees; wordlist refactorings/catalogue/opdyke/fowler/kramdown. - pages/refactorings/extract-method.md: drop the trailing blank lines.
Overcommit enables AuthorName and AuthorEmail pre-commit hooks by default, which check git config user.name and user.email. In GitHub Actions runners, these are unset, causing overcommit --run to fail in CI.
The hook should only enforce that files end with a newline (preventing POSIX/git missing-newline errors), not fail on multiple trailing blank lines which occurs naturally in source files like Optics.hs.
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.
No description provided.