Conversation
tsuzuki-takaaki
left a comment
Contributor
There was a problem hiding this comment.
Pull Request ありがとうございます!確認が遅くなってすみません 🙏
コメントしたので、ご確認をお願いします!
| ).filter( | ||
| (itemFilename) => | ||
| /\.md$/.test(itemFilename) && !itemFilename.startsWith(".remote/"), | ||
| /\.md$/.test(itemFilename) && isLocalMarkdownFilename(itemFilename), |
Contributor
There was a problem hiding this comment.
関数として切り出していただいた isLocalMarkdownFilename の中でも markdown ファイルかどうかの判定をしているので、こちらでの判定はなくても良さそうです!
Suggested change
| /\.md$/.test(itemFilename) && isLocalMarkdownFilename(itemFilename), | |
| isLocalMarkdownFilename(itemFilename), |
Contributor
There was a problem hiding this comment.
.filter(isLocalMarkdownFilename)のような感じで書けると良いかと思いました!
| ) | ||
| ).filter( | ||
| (filename) => /\.md$/.test(filename) && !filename.startsWith(".remote/"), | ||
| (filename) => /\.md$/.test(filename) && isLocalMarkdownFilename(filename), |
Contributor
There was a problem hiding this comment.
こちらも同様にお願いしたいです!
https://github.com/increments/qiita-cli/pull/428/changes#r4164656008
Contributor
There was a problem hiding this comment.
テスト名は、既存のテストに合わせて英語にしていただけると嬉しいです!
Comment on lines
+1
to
+2
| // `fs.readdir(..., { recursive: true })` が返す相対パスの区切り文字は OS 依存のため、 | ||
| // ".remote/" だけでなく ".remote\" (Windows) も除外できるように先頭セグメントで判定する。 |
Contributor
There was a problem hiding this comment.
このリポジトリでは、コードコメントは基本的に英語で書いているので、英語にしていただけると嬉しいです!
…sh comments/test names
Author
|
@tsuzuki-takaaki レビューありがとうございます!ご指摘の点を反映しました。
|
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.
What
Windows 環境で
.remoteディレクトリ内のファイルがローカルの記事・スライド一覧に混入するのを防ぎます。How
fs.readdir(..., { recursive: true })が返す相対パスの区切り文字は OS 依存(Windows では\)ですが、除外判定がfilename.startsWith(".remote/")と/固定でした。Windows では.remote\xxxx.mdが除外されず、そのまま記事ファイルとして読み込まれていました。先頭のパスセグメントで判定する
isLocalMarkdownFilenameを新設し、file-system-repo.tsとslide-file-system-repo.tsの両方のフィルタで使うようにしました。区切り文字の両方を網羅するテストを追加しています。Why
Windows 環境で
.remoteのミラーがローカルの記事・スライドとして重複して扱われ、プレビュー一覧への混入や、記事 ID 検索時にミラー側が先にヒットするなどの誤動作につながるため。Refs