libgit2 / libgit2/pygit2

Replace members by getters

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

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

主要言語
Python
スター
1.7k
フォーク
408
平均マージ
2日 57分
マージ済み PR(30日)
7

説明

For consistency and better performance (not creating objects that may not be used).

$ grep MEMBER src/*
src/diff.c:    MEMBER(DiffFile, id, T_OBJECT, "Oid of the item."),
src/diff.c:    MEMBER(DiffFile, path, T_STRING, "Path to the entry."),
src/diff.c:    MEMBER(DiffFile, raw_path, T_OBJECT, "Path to the entry (bytes)."),
src/diff.c:    MEMBER(DiffFile, size, T_LONG, "Size of the entry."),
src/diff.c:    MEMBER(DiffFile, flags, T_UINT, "Combination of GIT_DIFF_FLAG_* flags."),
src/diff.c:    MEMBER(DiffFile, mode, T_USHORT, "Mode of the entry."),
src/diff.c:    MEMBER(DiffDelta, status, T_UINT, "A GIT_DELTA_* constant."),
src/diff.c:    MEMBER(DiffDelta, flags, T_UINT, "Combination of GIT_DIFF_FLAG_* flags."),
src/diff.c:    MEMBER(DiffDelta, similarity, T_USHORT, "For renamed and copied."),
src/diff.c:    MEMBER(DiffDelta, nfiles, T_USHORT, "Number of files in the delta."),
src/diff.c:    MEMBER(DiffDelta, old_file, T_OBJECT, "\"from\" side of the diff."),
src/diff.c:    MEMBER(DiffDelta, new_file, T_OBJECT, "\"to\" side of the diff."),
src/note.c:    MEMBER(Note, id, T_OBJECT, "id of the note object."),
src/note.c:    MEMBER(Note, annotated_id, T_OBJECT, "id of the annotated object."),
src/reference.c:    MEMBER(RefLogEntry, oid_new, T_OBJECT, "New oid."),
src/reference.c:    MEMBER(RefLogEntry, oid_old, T_OBJECT, "Old oid."),
src/reference.c:    MEMBER(RefLogEntry, message, T_STRING, "Message."),
src/utils.h:#define MEMBER(type, attr, attr_type, docstr)\
src/utils.h:#define RMEMBER(type, attr, attr_type, docstr)\

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

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

はじめの一歩

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

調査の方向性

src/utils.h の MEMBER と RMEMBER の定義から始め、続いて src/diff.c、src/note.c、src/reference.c での使用箇所を調べます。ドキュメント化された属性を維持し、未使用のオブジェクトを作成しないようにしながら、列挙されたメンバーを getter に置き換えます。影響を受けるバインディングが一貫して動作することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, python
領域
devtools
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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