Refactor and optimize code
まだ誰も着手していません。
評価
調査の方向性
Start with the code and review discussion linked from pull request #41, since the issue does not identify files or tests. Separate the proposed refactors into an agreed scope, then run the existing project checks and confirm that the affected behavior remains covered after the changes.
索引モデルが issue の本文から書いたものです。
説明
@warrior-abhijit has suggested several changes to vcert-python code. We can address them together in one issue.
switch case will be better here ?
Originally posted by @warrior-abhijit in https://github.com/Venafi/vcert-python/pull/41#discussion_r488175192
address todo now ?? as these are lot of if, else in here
Originally posted by @warrior-abhijit in https://github.com/Venafi/vcert-python/pull/41#discussion_r488176457
regex match API would be lot better here and will remove lot of duplicate code below w.r.t regex match
Originally posted by @warrior-abhijit in https://github.com/Venafi/vcert-python/pull/41#discussion_r488177162
switch case may be here as well ?
Originally posted by @warrior-abhijit in https://github.com/Venafi/vcert-python/pull/41#discussion_r488177862
There is a handy Python wrapper called @property. This can be handy here. It would look like this:
@property
def base_url(self):
# This is a getter
return self._base_url
@base_url.setter
def base_url(self, value):
# This is the setter method
self._base_url = self._normalize_and_verify_base_url(value)
It's nicer for refactoring and is pretty explicit.
Originally posted by @HELGAHR in https://github.com/Venafi/vcert-python/pull/41#discussion_r492452816
How safe is it in this method to assume that these dictionary keys resolve? I'm new to this code, but I usually think thrice before trying to access a node in the dictionary without .get().
Originally posted by @HELGAHR in https://github.com/Venafi/vcert-python/pull/41#discussion_r493173154
Just a tidbit of input: Python string objects have a .startswith() method that's easier to read than a regex, although a regex works fine.
Originally posted by @HELGAHR in https://github.com/Venafi/vcert-python/pull/41#discussion_r493173571
No use in having a doc string if the parameters aren't described, IMO.
Originally posted by @HELGAHR in https://github.com/Venafi/vcert-python/pull/41#discussion_r493174068
- 主要言語
- Python
- スター
- 22
- フォーク
- 23
- 平均マージ
- 2日 3時間
- マージ済み PR(30日)
- 13
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Venafi/vcert-python のほかの issue
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
Venafi/vcert-python#208 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
Venafi/vcert-python#133 · コメント 3 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Venafi/vcert-python#114 ·
-
Venafi/vcert-python#91 · 担当者 1 名 ·
Venafi/vcert-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/skills#1811 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
speaches-ai/speaches#678 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
datalayer/mcp-compose#42 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
conda-forge/spacy-feedstock#177 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
UKGovernmentBEIS/inspect_evals#2523 ·