Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactorisation channel #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Refactorisation channel #20

wants to merge 1 commit into from

Conversation

pilna
Copy link
Collaborator

@pilna pilna commented Feb 8, 2022

  • split the send method to add readability
  • change the type of skipuser in send method to set
  • add typing to all method
  • add documentation to all class and method

@pilna pilna closed this Feb 8, 2022
@pilna pilna reopened this Feb 8, 2022
@Julien00859
Copy link
Member

Julien00859 commented Feb 8, 2022

If we are to add rich docstring on methods, please do so on all methods as per pep8-introduction (emphasis mine):

A style guide is about consistency. Consistency with this style guide is important. Consistency within a project is more important. Consistency within one module or function is the most important.

Also I'm not really fond of adding imports just for the sake of typing, I'm speaking about importing user intro channel, quite frankly I did double check to determine if there was no circular import. I would prefer we go for a py3.6-style List["aioircd.user.User"], type as a string. edit thanks to the unittest, there indeed are some cicurlar imports. Did you run the tests on your end before opening this PR?

That TYPE_CHECKING stuff is maybe out of the scope of this project. We don't have plan to introduce static type checking anytime soon ourselves. Is this stuff part of a global plan you have to introduce typing into this project? If so I would prefer we discuss the matter in a dedicated issue.

Also, even if we don't have (for the moment) steps explaining how to contribute, we adopted a style for our commit messages. The style is as follow: (add|imp|ref|fix|perf|doc|misc): title under 50 chars. add is new stuff, imp is improvement of existing stuff, ref is major refactor. Could you also squash your commits?

@Julien00859
Copy link
Member

By the way, some tips on how to write commit messages.

Keep in mind that when one is hacking around some line of codes, that he spots some lines that are odds, he'll first git blame those lines to learn more about the commits that introduced them. In case of your commits, all he'll be able to read in his terminal will be:

commit 8794e0cd5e54e212af68c0956227cf22ce2cbb51 (HEAD -> refacto-channel, origin/refacto-channel)
Author: pilna <[email protected]>
Date:   Tue Feb 8 22:43:15 2022 +0100

	� fix import

commit ff7f459b8c324fa4166c1e75ab1644c622337926
Author: pilna <[email protected]>
Date:   Tue Feb 8 22:36:01 2022 +0100

	� add documentation to the channel class, and add safe import

commit 456823776720e066bf2e2ff0a1d79cc8086967ad
Author: pilna <[email protected]>
Date:   Tue Feb 8 19:31:58 2022 +0100

	� refacto channel.py and add documentation

Among them, the fix import is the most misleading. You are not fixing anything in the project but actually fixing a bug you introduced within this branch. As this branch is not merged yet, you could had amended that commit right away and force-push the branch. Force-pushing not-yet-merged branches is fine! --force-with-lease if you want to be a cool kid ;)

If you want some guidance on how we write commit messages, the following one can serves as a template: 8a5f866

* add documentation to all channel file.
* add typing to all channel file.
* rewrite send method.
	* change parameter skipusers to a Set to reduce the temporal complexity
	* add private method log message to increase readability and shorten the method (reduce the visual complexity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants