-
Notifications
You must be signed in to change notification settings - Fork 9
Add markdownlint pre-commit hooks, Build PRs on readthedocs #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mmaclay
merged 33 commits into
main
from
79-publish-example-builds-for-pr-review-checks
Mar 30, 2026
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
57f2d0e
Add GitHub Actions for Sphinx documentation build and update dependen…
mmaclay 6acedaf
Update documentation formatting and ensure all pages listed in toctree
mmaclay cfa2a2c
Add markdownlint and yamllint configurations for consistent linting
mmaclay d1bf9fa
Update .gitignore to include docs/build directory
mmaclay 3862fcd
Refactor documentation for markdownlint
mmaclay 80cb4ca
Update codespell ignore-words-list with explanations for clarity
mmaclay c15ec85
Fix missing newline at end of file in conf.py
mmaclay 7334f8c
Remove unnecessary blank lines in docs.yml
mmaclay 6067579
Add missing newlines at the end of files in index.rst
mmaclay 21fa40a
Add missing newline at end of LICENSE file
mmaclay 312117f
Update codespell ignore-words-list with additional comments for clarity
mmaclay 592e915
Enable autofix for pre-commit.ci and update markdownlint and codespel…
mmaclay 04c0995
Remove missing section in index
mmaclay b37955f
Opt into Node.js 24 for all actions in the workflow
mmaclay 3a2a823
Opt into Node.js 24 for all actions in the workflow
mmaclay 1279e0c
Add fail_on_warning to ReadTheDocs configuration and enhance Sphinx b…
mmaclay 2825f21
Remove empty jenkins_job_builder section from index
mmaclay a5d2acc
update comment
mmaclay ed888af
include yaml in lint
mmaclay 210d5c1
Update README.md to enhance contributing guidelines and clarify docum…
mmaclay 89266ae
Refine Sphinx Docs Build output formatting for clarity
mmaclay 417f941
Add CODEOWNERS file and PR triage workflow for automatic review reque…
mmaclay 8d6ec0e
Simplify post_install comment in .readthedocs.yaml for clarity
mmaclay 7c8946d
Fix typo in code of conduct regarding reporting violations
mmaclay fbff1ce
Add conditional check for Sphinx output in GitHub step summary
mmaclay 9d48594
Fix typos in pull_requests.md for clarity and correctness
mmaclay 38cf8ee
Update markdownlint configuration to use markdownlint-cli2 and adjust…
mmaclay 6d02ed8
Improve clarity in Docker documentation by updating links and phrasing
mmaclay 749c1d0
Enhance PR triage workflow by expanding review request triggers and a…
mmaclay 57760c7
orchid typo
mmaclay 3267db6
stop line length linting since it doesn't have auto fix
mmaclay 9a993d9
allow "here" links
mmaclay 3cf4fec
readthedocs python 311
mmaclay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # CODEOWNERS — automatic review suggestions | ||
| # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
| # GitHub automatically suggests dev-guide-admins as reviewers for all PRs. | ||
|
|
||
| # Request review from dev-guide-admins team for all files | ||
| * @lasp/dev-guide-admins |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: Docs Build | ||
|
|
||
| # Fast CI error-gate: catches broken toctrees, bad references, and Sphinx | ||
| # warnings before merge. Runs in ~2 min. | ||
| # | ||
| # The live browsable preview is handled by ReadTheDocs, which posts its own | ||
| # status check ("docs/readthedocs.com") with a direct URL when a PR build | ||
| # completes. Enable it once in the RTD dashboard: | ||
| # Admin → Advanced Settings → "Build pull requests for this project" ✓ | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
|
|
||
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
|
|
||
| jobs: | ||
| sphinx: | ||
| name: Build Sphinx docs | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install Poetry | ||
| run: python -m pip install poetry | ||
|
|
||
| - name: Install dependencies | ||
| run: poetry install | ||
|
|
||
| - name: Build docs (warnings = errors) | ||
| id: build | ||
| shell: bash | ||
| run: | | ||
| set -o pipefail | ||
| poetry run sphinx-build -W --keep-going -n \ | ||
| docs/source docs/source/build 2>&1 | tee /tmp/sphinx-output.txt | ||
|
|
||
| - name: Write job summary | ||
| if: always() | ||
| shell: bash | ||
| run: | | ||
| { | ||
| echo "## Sphinx Docs Build" | ||
| echo "" | ||
| if [ "${{ steps.build.outcome }}" = "success" ]; then | ||
| echo "### Build passed — no warnings" | ||
| else | ||
| echo "### Build failed — see warnings below" | ||
| fi | ||
| echo "" | ||
| echo "> **Live preview:** see the **ReadTheDocs** status check below for a" | ||
| echo "> clickable URL to browse the built docs directly." | ||
| echo "" | ||
| if [ -f /tmp/sphinx-output.txt ]; then | ||
| echo "<details><summary>Full Sphinx output</summary>" | ||
| echo "" | ||
| echo '```' | ||
| cat /tmp/sphinx-output.txt | ||
| echo '```' | ||
| echo "" | ||
| echo "</details>" | ||
| fi | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: PR Triage | ||
|
|
||
| # Automatically request review from dev-guide-admins when a PR is ready for review. | ||
| # Covers two cases: | ||
| # - PR opened directly as ready for review (opened, reopened) | ||
| # - Draft PR converted to ready for review (ready_for_review) | ||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened, ready_for_review] | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
| issues: write | ||
|
|
||
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
|
|
||
| jobs: | ||
| triage: | ||
| name: Request review from triage team | ||
| # Skip draft PRs — only run when the PR is actually ready for review | ||
| if: github.event.pull_request.draft == false | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| # Request review from the dev-guide-admins team. | ||
| # Also posts a comment mentioning the team as a reliable fallback notification, | ||
| # since requestReviewers can silently fail for teams in some org configurations. | ||
| - name: Request review and notify dev-guide-admins | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const pr = context.payload.pull_request.number; | ||
| const { owner, repo } = context.repo; | ||
|
|
||
| // Attempt to assign the team as a formal reviewer | ||
| try { | ||
| await github.rest.pulls.requestReviewers({ | ||
| owner, | ||
| repo, | ||
| pull_number: pr, | ||
| team_reviewers: ['dev-guide-admins'], | ||
| }); | ||
| console.log('Successfully requested review from dev-guide-admins'); | ||
| } catch (err) { | ||
| // Log the error but don't fail — the comment below still notifies the team | ||
| console.error('requestReviewers failed:', err.message); | ||
| } | ||
|
|
||
| // Post a comment mentioning the team so they are always notified | ||
| await github.rest.issues.createComment({ | ||
| owner, | ||
| repo, | ||
| issue_number: pr, | ||
| body: '@lasp/dev-guide-admins — this PR is ready for review.', | ||
| }); |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| .idea/ | ||
| docs/source/build | ||
| docs/build | ||
| docs/build |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Markdownlint configuration for markdownlint-cli2 (Node.js) | ||
| # Rule reference: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md | ||
| # | ||
| # This mirrors the exclusions in .mdl_style.rb (used by the Ruby mdl gem) | ||
| # so both tools agree. The .mdlrc / .mdl_style.rb files can be retired once | ||
| # the team is fully on markdownlint-cli. | ||
|
|
||
| default: true | ||
|
|
||
| # -- Line length -------------------------------------------------------------- | ||
| # Disabled: MD013 cannot be auto-fixed by markdownlint --fix (it would require | ||
| # editorial judgment about where to wrap prose). Enforcing it creates friction | ||
| # for contributors and has no effect on the rendered Sphinx/HTML output. | ||
| MD013: false | ||
|
|
||
| # -- Disabled rules (match .mdl_style.rb exclusions) ------------------------- | ||
| MD014: false # Dollar signs before commands without showing output — allowed | ||
| MD029: false # Ordered list item prefix — allow repeating "1." style | ||
| MD033: false # Inline HTML — allowed | ||
| MD034: false # Bare URLs — allowed | ||
| MD036: false # Emphasis used instead of a heading — allowed | ||
| MD059: false # Descriptive link text — "here" links can't be auto-fixed; cosmetic only | ||
|
|
||
| # -- Additional sensible rules ------------------------------------------------ | ||
| # Enforce consistent heading style (ATX = # style, not underline style) | ||
| MD003: | ||
| style: atx | ||
|
|
||
| # Enforce consistent unordered list marker (* vs - vs +) | ||
| MD004: | ||
| style: consistent | ||
|
|
||
| # No multiple blank lines | ||
| MD012: | ||
| maximum: 1 | ||
|
|
||
| # No hard tabs | ||
| MD010: | ||
| spaces_per_tab: 4 | ||
|
|
||
| # Fenced code blocks should have a language specified | ||
| MD040: true | ||
|
|
||
| # No trailing punctuation in headings | ||
| MD026: | ||
| punctuation: ".,;:!" | ||
|
|
||
| # -- Disabled rules (repo convention) ----------------------------------------- | ||
| # The guideline template consistently uses 2-space sub-bullets under numbered | ||
| # lists (e.g., 1. **Step** \n - detail). Enforcing MD007 would require | ||
| # rewriting every How-to-Apply section across the whole site. | ||
| MD007: false | ||
|
|
||
| # Tight lists (no blank lines between items) are idiomatic in this repo's | ||
| # guideline pages. MD032 would require blank lines around every list block. | ||
| MD032: false | ||
|
|
||
| # Table column alignment style is overly strict for contributors and produces | ||
| # false positives on wide-cell tables — disable until a consistent table style | ||
| # is established across the whole site. | ||
| MD060: false |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| style "#{File.dirname(__FILE__)}/.mdl_style.rb" | ||
| style "#{File.dirname(__FILE__)}/.mdl_style.rb" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,86 @@ | ||
| ci: | ||
| autofix_prs: false | ||
| # pre-commit.ci (https://pre-commit.ci) — free for open-source repos. | ||
| # When enabled, it runs all hooks on every PR and commits any auto-fixes | ||
| # back to the PR branch automatically (no local setup required for contributors). | ||
| # Hooks that can auto-fix: end-of-file-fixer, trailing-whitespace, | ||
| # mixed-line-ending, markdownlint (--fix), codespell (--write-changes). | ||
| # Hooks that only detect (still require a human fix): check-yaml, | ||
| # check-merge-conflict, rstcheck, yamllint. | ||
| autofix_prs: true | ||
| autoupdate_schedule: 'quarterly' | ||
| # rstcheck needs a full Sphinx/Poetry environment that pre-commit.ci | ||
| # doesn't have — skip it there and let docs.yml in GitHub Actions cover it. | ||
| skip: [rstcheck] | ||
|
|
||
| repos: | ||
| # --------------------------------------------------------------------------- | ||
| # General file hygiene | ||
| # --------------------------------------------------------------------------- | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| args: ['--maxkb=1000'] | ||
| - id: detect-aws-credentials | ||
| args: [--allow-missing-credentials] | ||
| - id: detect-private-key | ||
| - id: mixed-line-ending | ||
| - id: trailing-whitespace | ||
| - id: no-commit-to-branch | ||
| args: [--branch, main] | ||
| - id: check-added-large-files # block files > 1 MB | ||
| args: ['--maxkb=1000'] | ||
| - id: check-case-conflict # catch Mac/Windows case insensitivity bugs | ||
| - id: check-merge-conflict # catch leftover <<<< ==== >>>> markers | ||
| - id: check-yaml # validate all YAML files (workflows, config) | ||
| - id: detect-aws-credentials | ||
| args: [--allow-missing-credentials] | ||
| - id: detect-private-key | ||
| - id: end-of-file-fixer # ensure every file ends with a newline | ||
| - id: mixed-line-ending | ||
| - id: no-commit-to-branch | ||
| args: [--branch, main] | ||
| - id: trailing-whitespace | ||
| # --markdown-linebreak-ext preserves intentional two-space line breaks in .md | ||
| args: [--markdown-linebreak-ext=md] | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Markdown linting | ||
| # Config: .markdownlint.yaml (mirrors the existing .mdl_style.rb exclusions) | ||
| # markdownlint-cli2 is the official CLI maintained by the markdownlint author (DavidAnson). | ||
| # --------------------------------------------------------------------------- | ||
| - repo: https://github.com/DavidAnson/markdownlint-cli2 | ||
| rev: v0.19.1 | ||
mmaclay marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| hooks: | ||
| - id: markdownlint-cli2 | ||
| # --fix auto-corrects issues with a safe mechanical fix. | ||
| # Issues requiring human judgement are still reported as errors. | ||
| args: [--fix, --config, .markdownlint.yaml] | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # reStructuredText validation (toctree, directives, broken references) | ||
| # --------------------------------------------------------------------------- | ||
| - repo: https://github.com/rstcheck/rstcheck | ||
| rev: v6.2.4 | ||
| hooks: | ||
| - id: rstcheck | ||
| additional_dependencies: ['rstcheck-core', 'sphinx'] | ||
| args: [--report-level=warning] | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # YAML linting — catches style issues in workflow files and config | ||
| # Config: .yamllint.yaml | ||
| # --------------------------------------------------------------------------- | ||
| - repo: https://github.com/adrienverge/yamllint | ||
| rev: v1.35.1 | ||
| hooks: | ||
| - id: yamllint | ||
| args: [--config-file, .yamllint.yaml] | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Spell checking (.md, .rst, .yml, .yaml) | ||
| # --------------------------------------------------------------------------- | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.4.1 | ||
| hooks: | ||
| - id: codespell | ||
| files: ^.*\.(md|rst|yml)$ | ||
| files: ^.*\.(md|rst|ya?ml)$ | ||
| args: | ||
| # --write-changes auto-corrects unambiguous spelling mistakes. | ||
| # Ambiguous corrections (multiple candidates) are still reported. | ||
| - --write-changes | ||
| # nd/ND = Creative Commons "No Derivatives" | ||
| # SORCE = Solar Radiation and Climate Experiment (NASA mission) | ||
| # sav = IDL save file extension | ||
| - --ignore-words-list=nd,ND,SORCE,sav | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.