Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Refactor and optimize code

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

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
api

調査の方向性

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 の本文から書いたものです。

説明

enhancement

@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

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

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

はじめの一歩

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

Venafi/vcert-python のほかの issue

Venafi/vcert-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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