Check for invalid format specifiers
まだ誰も着手していません。
評価
調査の方向性
まず、PyCQA/pyflakes#443 で追加された tokenizer と、.format 文字列に関する Python の string.Formatter.parse ドキュメントを確認します。そのアプローチを、pygments や parso など、挙げられている f-string のトークン化の選択肢と比較します。.format 文字列と f-string の両方で f.1 のような無効なフォーマット指定子が検出されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
pyflakes does some format specifier checks (https://github.com/PyCQA/pyflakes/pull/443), but it isn't able to detect invalid format specifiers. For example
f"{x:f.1}"
"{x:f.1}".format(x=1)
are both wrong (the f is supposed to go after the .1). Also the f-string one is a ValueError and is only checked at runtime.
The format specification mini-language is pretty complicated, so this would be useful, but also maybe not easy to implement. For .format strings you can use https://docs.python.org/3/library/string.html#string.Formatter.parse, but for f-strings, there's nothing in the standard library that can tokenize the f-string components (it would be useful if there were). Libraries like pygments and parso can tokenize them, or maybe the tokenizer added in https://github.com/PyCQA/pyflakes/pull/443 can be extended to handle them.
- 主要言語
- Python
- スター
- 1.5k
- フォーク
- 205
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 5
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PyCQA/pyflakes のほかの issue
-
F542 is not a crimeオープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
-
Use of await in a function that is not async should be shown as a syntax error by flake8再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
micropython/micropython#19906 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
FinanceFlash/unvibecode#597 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
TomAnthony/YourOwnWeigh#21 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: Compliance rules never see Unity Catalog views as views対応中かも @wagnercsantos が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
databrickslabs/ontos#1348 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信