Skip to content
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

cleanup: trim trailing whitespace #11136

Merged
merged 3 commits into from
Jul 7, 2023
Merged

cleanup: trim trailing whitespace #11136

merged 3 commits into from
Jul 7, 2023

Conversation

okayurisotto
Copy link
Contributor

What

行末の意味のない空白文字を削除しました。

Why

別件で編集していたとき、本筋ではない部分で差分が発生することになり気になったため。

Additional info (optional)

たくさんのファイルを編集したことから他のPRとコンフリクトすることが考えられます。私が少し気になっただけですので、不要でしたらこのPRは閉じてしまってください。

.editorconfigtrim_trailing_whitespace = trueを書くことで今後このような空白が追加されることを防ぎました。なおMarkdown内では行末の半角空白が改行を意味する場合があるため、この設定は無効化してあります。

pugファイルにあるMisskeyのアスキーアートには触れないでおきましたが、pugファイルでの設定無効化は行っていません。そのため、今後pugファイルを編集したときにはエディターによってアスキーアート部分が書き換えられてしまいます。どうすべきか意見を伺いたいです。

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@syuilo
Copy link
Member

syuilo commented Jul 6, 2023

逆に空行のインデント部分を必ず残すように強制させることってできないかな
VSCodeとかでマルチカーソルで複数行編集するときに空行のインデントがされていないとズレてしまう

@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Merging #11136 (170a13d) into develop (4a7da72) will decrease coverage by 0.47%.
The diff coverage is 59.56%.

@@             Coverage Diff             @@
##           develop   #11136      +/-   ##
===========================================
- Coverage    77.83%   77.37%   -0.47%     
===========================================
  Files          170      907     +737     
  Lines        21468    91641   +70173     
  Branches       498     7551    +7053     
===========================================
+ Hits         16710    70903   +54193     
- Misses        4758    20738   +15980     
Impacted Files Coverage Δ
packages/backend/src/core/AiService.ts 47.61% <0.00%> (ø)
packages/backend/src/core/EmailService.ts 17.77% <0.00%> (ø)
...s/backend/src/core/FetchInstanceMetadataService.ts 22.66% <0.00%> (ø)
packages/backend/src/core/InstanceActorService.ts 59.09% <0.00%> (ø)
packages/backend/src/core/RoleService.ts 75.50% <0.00%> (ø)
...ackages/backend/src/core/VideoProcessingService.ts 43.10% <0.00%> (ø)
...ackend/src/core/activitypub/ApDbResolverService.ts 52.97% <0.00%> (ø)
...e/processors/ImportCustomEmojisProcessorService.ts 39.34% <0.00%> (ø)
...queue/processors/WebhookDeliverProcessorService.ts 38.75% <0.00%> (ø)
...server/api/endpoints/admin/announcements/update.ts 77.77% <0.00%> (ø)
... and 86 more

... and 655 files with indirect coverage changes

@okayurisotto
Copy link
Contributor Author

.editorconfig[*]に対してtrim_trailing_whitespace = falseを設定すれば、勝手にtrimされるようなことはなくなるはずです。この設定はVS Codeではeditor.trimAutoWhitespaceにあたると思われます。

ただ、意図した数のインデントをあとから付け加えるタイプのフォーマッタがあるかどうかまでは少しわかりません……。

(個人的には空行のインデントはあってもなくてもよくて、とりあえずまちまちな状況さえなくなれば意図しない差分で困ることがないのでうれしいです。)

@syuilo syuilo merged commit d847965 into misskey-dev:develop Jul 7, 2023
4 of 8 checks passed
@syuilo
Copy link
Member

syuilo commented Jul 7, 2023

🙏

@okayurisotto okayurisotto deleted the trim-trailing-whitespace branch July 11, 2023 11:25
slofp pushed a commit to Secineralyr/misskey.dream that referenced this pull request Jul 21, 2023
* cleanup: trim trailing whitespace

* update(`.editorconfig`)

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants