bin/lint の更新により、バンドルされていないプラグインのリンティングフローが破損

Discourse の main ブランチでの最近の変更 (https://github.com/discourse/discourse/commit/e84d7c9f26ed) により、現在開発中のカスタムプラグインのリント方法が機能しなくなりました。

PR/コミットの主題は以下の通りです。

DEV: Update bin/lint to work correctly for non-bundled plugins

そのため、リントワークフローのどこかが根本的に間違っているのではないかと思っています(cc @david)。

私のリント方法

私が bin/lint を使っていた方法は、Discourse のルートディレクトリから実行し、プラグインディレクトリ内の自分のプラグインを指定するというものでした。

bin/lint --fix plugins/my-custom-plugin

上記のコミットにより、この方法は機能しなくなりました。プラグインディレクトリ内で pnpm が実行されたというエラーが発生し、その後ファイルが見つからなくなります。エラー出力の一例を以下に示します。

> pnpm was run inside a plugin directory. Re-executing with --ignore-workspace...
NoFilesFoundError: No files matching the pattern "plugins/zlb-community/assets/stylesheets/common/atoms/category-button.scss, plugins/zlb-community/assets/stylesheets/common/atoms/category-icon.scss, plugins/zlb-community/assets/stylesheets/common/atoms/icon-info.scss, plugins/zlb-community/assets/stylesheets/common/atoms/user-pill.scss, plugins/zlb-community/assets/stylesheets/common/base/grid.scss, plugins/zlb-community/assets/stylesheets/common/base/normalize.scss, plugins/zlb-community/assets/stylesheets/common/base/rich-text.scss, plugins/zlb-community/assets/stylesheets/common/base/stack.scss, plugins/zlb-community/assets/stylesheets/common/index.scss, plugins/zlb-community/assets/stylesheets/common/molecules/card.scss, plugins/zlb-community/assets/stylesheets/common/molecules/expander.scss, plugins/zlb-community/assets/stylesheets/common/molecules/header.scss, plugins/zlb-community/assets/stylesheets/common/molecules/user-pill-list.scss, plugins/zlb-community/assets/stylesheets/common/organisms/category-header.scss, plugins/zlb-community/assets/stylesheets/common/templates/lobby.scss, plugins/zlb-community/assets/stylesheets/community-sidebar.scss, plugins/zlb-community/assets/stylesheets/user_home.scss, plugins/zlb-community/assets/stylesheets/common/atoms/badge.scss" were found.
    at standalone (file:///Users/max/code/bitcrowd/zlb/discourse/plugins/zlb-community/node_modules/.pnpm/stylelint@17.5.0_typescript@5.9.3/node_modules/stylelint/lib/standalone.mjs:293:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

以前は完全に問題なく動作していました。この変更前のコミットに戻らない限り、ルートディレクトリで bin/lint をグローバルに実行するしかありませんが、それは明らかに時間がかかりすぎます。

これは異なる方法で行うべきでしょうか?

@klappradla さんのご報告ありがとうございます。これで修正できるはずです:

ありがとうございます!

ご提示いただいた修正ブランチを試してみましたが、完全には機能しませんでした。template-lint で停止してしまい、その後のチェックが実行されないようです。

stylelint が ember-template-lint の後に実行されていると推測されますが、出力が空のため明確ではありません。簡単な進行状況の出力と最終的なサマリーを追加するコミットをプッシュしました。

更新されたブランチを試しましたが、問題は別の場所にあると思います。サマリーが表示されるようになったのは素晴らしいですが、正しいファイルを見ていないようです :joy:

146fb61e104e と比較すると、.scss.js ファイルに追加したリンティング違反を検出できていません。

テスト中に SCSS と JS ファイルに違反を追加してみましたが、うまくいったようです。bin/lint --verbose plugins/my-custom-plugin を実行して、出力にファイルが正しくリストされているか確認していただけませんか?

verbose に関するご指摘、その通りですね!

はい、ファイルパスは問題なく、正常に報告されることを確認しました。ただし、--fix を渡すと何も反応しません。そこでの API を変更されましたか?

あー…… :facepalm:

またコミットをプッシュしちゃいました。もう一度試してもらえますか?

素晴らしい!今は問題なく動作しています :tada:

返信が遅くなり申し訳ありませんでした。コンピューター以外の業務で不在でした。

素晴らしい、ご協力ありがとうございます!PR をマージしました :rocket: