Skip to content

Conversation

@m-tsuru
Copy link
Contributor

@m-tsuru m-tsuru commented Sep 29, 2025

This PR resolves #279.

チケットへのリンク

#279

このレビューで確認して欲しい点

  • CI が正しく動作していること
  • 新しいコミットで正しく Markdown が fix されていること
  • MD013, MD024, MD041 が無効化されていること
    • MD013: 行の長さ。自動 Fix されないため無視
    • MD024: 同じ内容の複数の見出し。H2 -> H3 -> H2 -> H3 のような構成の繰り返しの文書で、H3 が適切に設定されているが、文字列が重複している場合に指摘されるのが好ましくないため無視
    • MD041: 最初の行は見出しレベル1でなければならない。Sphinx 関係で一旦そうできない場合がある可能性を考慮して無視
  • mdlint.yml について、サプライチェーン攻撃を防ぐために、利用するステップのコミットタグが固定されていること

@m-tsuru m-tsuru mentioned this pull request Sep 29, 2025
3 tasks
Copy link
Member

@ryu22e ryu22e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントしましたー

config: '.markdownlint-cli2.jsonc'

# 3. 変更されたファイルをコミット&プッシュ
- name: Commit and push changes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Actions経由でのgit pushだとmdlint.ymlでパーミッションの変更の設定が必要になってしまうので、たぶんこの内容だとgit pushでエラーになります。
stefanzweifel/git-auto-commit-actionのドキュメントによると、以下の設定を書いているようです。

    permissions:
      # Give the default GITHUB_TOKEN write permission to commit and push the
      # added or changed files to the repository.
      contents: write

ただ、ちゃんと動くか動作確認が大変そうなので、このmdlint.ymlの中では自動修正まではやらないで、ルール違反のmarkdownがあったらエラー扱いする程度でいいかと思いますー。

自動修正をやりたいなら、pre-commitを使ってローカルでgit commitするときにmarkdownlint-cli2を実行させるようにようにする手があるかと思います。
設定例: https://github.com/DavidAnson/markdownlint-cli2#pre-commit

Copy link
Contributor Author

@m-tsuru m-tsuru Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-commit を設定するとなると,ローカルの環境で markdownlint-cli2 をインストールすることをさせなければなりませんが,なんとなくこっちの都合でそれに付き合わせるのも変な感じですので,エラーを吐かせるぐらいがちょうど良さそうですね.方針をその方向に変更します. え,待って,そうである必要がない?

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.

Markdownlint を導入したい

2 participants