Skip to content

Conversation

@fuji44
Copy link
Contributor

@fuji44 fuji44 commented Oct 30, 2022

プロダクトコードのフォーマットが整っていなかったため確認したところ、black、isort、flake8、pre-commitの設定が適切でなく、正しく動作しづらい状態でした。
そこでそれぞれの設定の見直しと、全体を再フォーマットしました。

fix: #125

@fuji44 fuji44 requested a review from ueno-k-work October 30, 2022 15:02
@fuji44 fuji44 self-assigned this Oct 30, 2022

[flake8]
max-line-length = 88
extend-ignore = E203,E501
Copy link
Contributor Author

@fuji44 fuji44 Oct 30, 2022

Choose a reason for hiding this comment

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

E501は行の文字数チェックです。

このチェックは、ほとんどの場合はblackで88行にフォーマットされるため回避できます。長い文字列やコメント行などはblackが無視するための残りますが、モダンな開発環境では文字数の切りつめがそれほど重要でなく、切り詰めるためだけにコード変更を行うのは本末転倒だと考え、無効化しました。

repos:
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.10.0
Copy link
Contributor Author

@fuji44 fuji44 Oct 30, 2022

Choose a reason for hiding this comment

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

#125 の問題。
issueに書いた回避策では pre-commit で動作しなかったため、バージョンアップで対処。

@fuji44 fuji44 marked this pull request as ready for review October 30, 2022 15:18
@fuji44 fuji44 mentioned this pull request Nov 3, 2022
Copy link
Contributor

@ueno-k-work ueno-k-work left a comment

Choose a reason for hiding this comment

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

LGTM

@ueno-k-work ueno-k-work merged commit dc56dbc into main Nov 7, 2022
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.

black does not work well

3 participants