-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Should we make dateutil.rrule a development pattern? #193
Comments
I like the idea of using About the imports, I believe this is a little bit pedantic. I prefer what makes the code more easy to read. Which can change in different situations. Furthermore, I do think this problem does not exists yet. We do not have regular contributions for that happens. Again, nothing prevent us to make suggestion during the review process. If I would choose I will with the What do you think? |
Totally agree, @jvanz. That's my thought. |
Sorry for the delayed response. I had personal problems. First, to be sure we are on the same page, I believe the correct theme we are discussing here is a "Style Guide". When talking about both I couldn't find any research on the specific topic (effects of style guides for contributors in open source projects) that could make discussing about it pretty clear :/ Although, this is a good read and their systematic review gives way too many insights about documentation, lack of domain expertise, etc. I'm loosely trying to apply some of the stuff they talk about in the review to this project when making this comment. This is also a good read and many points are already implemented in this project! On Style GuideMy general opinion is (I separated in topics so I can elaborate on each one later):
1. new contributors should benefit from a simple and concise style guideThis topic addresses
A style guide should make life easier for those who are not used to these type of domains, both scraping and gazettes. There is no need to reinvent the wheel or go searching in the codebase what is acceptable if there are solutions that could be documented and readily available. Whatever we do to take away the burden of learning Scrapy, the Gazettes domain of expertise and project's tacit rules, should make an improvement on casual contribution (and the next topic is about making sure this does not get out of hand). 2. a style guide should only address the most common patterns in the projectToo much documentation is daunting for a casual contributor and should be avoided. Things like "every spider needs to inherit from Styling guides for "date ranges" and "pagination" are desirable in my opinion (if there are simple solutions) as those are the most common ways of link generation/discovery for spiders in this domain. Two sets of rules would cover most of the spiders and would make the code more consistent. Method naming could be a thing too. There is no need to decide between "get" or "parse" (or any other verb) if it has already been decided what to use. Staying limited to the most common of the patterns in the project could make a quick skim through the Style Guide page and then keeping it open as a reference through development much easier for the casual contributor. Avoiding the need of looking through the project to discover the tacit rules and acceptable solutions for the problem at hand. 3. the style guide should be enforced automatically whenever possible (and notify contributors about it)The importing rules could be easily enforced with a formatter and pre-commit. I agree with both of you that if we were to choose something it would be 4. rules which are not automatically enforceable should be few and simple, as they should only be enforced during the review processOnly easily identifiable and common stuff about the style guide should be left to the reviewer to enforce. Everything that can be automated should be automated and the review should focus more on the correctness of the data being scraped, performance tips, general readability tips, stuff like that. 5. a well-enforced style guide would make project readability and maintenance easier.This is just a wrap-around, I already covered this explaining what I meant in the above topics. On
|
As a Open Source contributor for while already, I agree that the style guide it is important and know that it may facilitate and save time in many sitautions. And I think nobody is against it. What I was trying to explain in my previous comment was this is not in our top of priorities. One of the reasons for that is because the need for something for formal does not happened yet. Well, this is a open source project. Open an PR with some suggestions, then we can discuss on something more concrete. ;-) |
During code review of pull request #192, @giuliocc suggested the use of
dateutil.rrule
instead of the built-in functionrange
to generate date candidates used to search for Gazettes. I'm creating this issue to discuss the pros and cons of using it.Originally posted by @giuliocc in #192
Indeed, it has a nice interface. We just need to discuss some details before deciding if we're turning it into a development pattern or not.
We'll likely have to use
datetime
objects (date
anddatetime
) to make use ofrrule
. We need to agree on how we're importing those objects. Otherwise, we would be generating more code diversity.import datetime
import datetime as dt
from datetime import date, datetime
Also, we need to consider if turning this into a development pattern would make it more difficult for first-time contributors or beginners to contribute to the project.
The text was updated successfully, but these errors were encountered: