openzim / openzim/python-scraperlib

[next major] Do not shadow Python standard-library module

オープン
#246 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

@benoit74 がすでに取り組んでいます。

2025年1月20日 から。

enhancement
主要言語
Python
スター
31
フォーク
27
平均マージ
3日 7時間
マージ済み PR(30日)
2

説明

Ruff / Flake8 has a new rule A005: https://docs.astral.sh/ruff/rules/stdlib-module-shadowing/

It is recommended to not shadow Python standard-library modules.

Currently, we have 5 issues:

src/zimscraperlib/html.py:1:1: A005 Module `html` shadows a Python standard-library module
src/zimscraperlib/logging.py:1:1: A005 Module `logging` shadows a Python standard-library module
src/zimscraperlib/rewriting/html.py:1:1: A005 Module `html` shadows a Python standard-library module
src/zimscraperlib/types.py:1:1: A005 Module `types` shadows a Python standard-library module
src/zimscraperlib/typing.py:1:1: A005 Module `typing` shadows a Python standard-library module

For now, I've disabled the rule A005 in https://github.com/openzim/python-scraperlib/pull/245 but we need to make a finer decision.

I think that logging module is shadowing "on-purpose" and might be allowed. Others could be considered for renaming. But I don't have very good suggestions of names, so I'm not 100% convinced, if we end-up with bad names, I'm not sure it really ease maintenance at all.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。