-
Notifications
You must be signed in to change notification settings - Fork 543
Implement date-checker #1037
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
Implement date-checker #1037
Conversation
Should I add something to Travis CI that runs |
Note to reviewers: You probably will want to review |
@rylev are you interested in reviewing this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I just have a few nits. Can we run this manually to confirm it works?
#[derive(Debug, Copy, Clone, PartialEq, Eq)] | ||
struct Date { | ||
year: u32, | ||
month: u32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should limit this to u8
if not a custom enum for the specific twelve months. Incorrectly formatted dates will likely propagate pretty far into this and could be somewhat hard to debug. Might be best to try to catch them as early as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should limit this to
u8
I tried that at first but it requires using TryInto
because chrono
uses u32
.
if not a custom enum for the specific twelve months
That seems like unnecessary complexity to me. At some point it might be good to have a --validate
mode that makes sure all the dates are valid (e.g. not in the future) and put that in CI, but I don't think we should do that here.
} | ||
|
||
fn make_date_regex() -> Regex { | ||
Regex::new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if lazy_static
would be one too many dependencies but it might make sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to use once_cell, since it will soon be upstreamed into the standard library: rust-lang/rfcs#2788
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's okay to leave this as-is for now and we can always change it later? I would like to get this merged :)
I tested this on a private repo and it seems to work. I had to manually trigger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Is this ready to merge? |
I think it's close, I personally am just waiting to hear back on #1037 (comment) :) |
I would also like to manually squash my commits so all the date-checker stuff is in one and all the docs updates for date-check annotations are in another. So: please let me know before you merge and please if possible don't use "Squash and merge" :) |
Next steps:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge! We can always work on improvements as we start using this.
Okay, squashing now... |
This tool looks for HTML comments like `<!-- date: 2021-01 -->` in each Markdown source file and compiles a list of dates that are older than six months. It then opens an issue with that list, with checkboxes for each file and date. Note that it will only open an issue if there was at least one date older than six months; it does nothing if the list is empty. This tool is automatically run monthly in a GitHub Actions workflow. I have tested the tool on a private repo and confirmed that it works.
Also added dates for things that previously said "as of now" or "as of this writing" and cleaned up a couple of things along the way.
@LeSeulArtichaut this should be ready now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't read through this, but approving because I trust @rylev's judgement and we can always revert if we need to.
Closes #1018.
This tool looks for HTML comments like
<!-- date: 2021-01 -->
in eachMarkdown source file and compiles a list of dates that are older than
six months. It then opens an issue with that list, with checkboxes for
each file and date. Note that it will only open an issue if there was at
least one date older than six months; it does nothing if the list is
empty.
This tool is automatically run monthly in a GitHub Actions workflow.
I have tested the tool on a private repo and confirmed that it works.