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

make date-check more lightweight #1394

Merged
merged 20 commits into from
Aug 2, 2022
Merged

Conversation

tshepang
Copy link
Member

No description provided.

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes some sense to me.

@camelid camelid self-assigned this Jul 17, 2022
@camelid camelid added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Jul 17, 2022
src/contributing.md Outdated Show resolved Hide resolved
@spastorino
Copy link
Member

Hmmm, I'm neutral to this change but consider that after this is merged, the text is more likely to be changed or removed to something else without being noticed.

ci/date-check/src/main.rs Outdated Show resolved Hide resolved
ci/date-check/src/main.rs Outdated Show resolved Hide resolved
Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments above. Overall this looks good. Nice idea!

@camelid
Copy link
Member

camelid commented Jul 18, 2022

Hmmm, I'm neutral to this change but consider that after this is merged, the text is more likely to be changed or removed to something else without being noticed.

Hmm, that is a good point. It looking more natural does make it less obvious that it's read by a tool...

tshepang added a commit to tshepang/rustc-dev-guide that referenced this pull request Jul 18, 2022
tshepang added a commit to tshepang/rustc-dev-guide that referenced this pull request Jul 18, 2022
@tshepang tshepang requested a review from camelid July 18, 2022 20:27
@tshepang
Copy link
Member Author

tshepang commented Jul 18, 2022

I found it tedious to write the date twice when updating things. I also made it more clear what date formats are accepted (as suggested by @camelid), so hopefully it's less hidden if the formats are processed by a tool. Am also thinking that as a WG, we are all aware of this tool (at least the more active of us), and all PRs that violate the format can be fixed, without even burdening the submitter to comply, since we could just add a fixup commit to their PR.

@spastorino
Copy link
Member

If we don't want to repeat the date and still be explicit that we are checking it, what about ...

When you don't want the date to show up in the text: <!-- check-date: July 2022 -->
When you want the date to show up in the text: <!-- check-date: -->July 2022

@camelid
Copy link
Member

camelid commented Jul 24, 2022

If we don't want to repeat the date and still be explicit that we are checking it, what about ...

When you don't want the date to show up in the text: <!-- check-date: July 2022 --> When you want the date to show up in the text: <!-- check-date: -->July 2022

I like this idea. Or even shorter: <!-- track: July 2022 --> and <!-- track: -->July 2022. Maybe that wouldn't be clear enough though?

@tshepang
Copy link
Member Author

I named it date-check in a branch am still working on, which matches name of tool

tshepang and others added 8 commits July 30, 2022 21:47
@tshepang
Copy link
Member Author

This was rebased, but the only real change is the latest commit e82c245.

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is very close. My only main concern is the complexity of having two regexes. I think it should be possible to have just one (slightly more permissive) regex. The rest of the comments are just stylistic nitpicks.

Comment on lines 41 to 42
r"<!--\s+date-check:\s+(\w+)\s+(\d+{4})\s+-->",
r"<!--\s+date-check\s+-->\s+(\w+)\s+(\d+{4})",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the + after \d is correct (it wasn't there before either):

Suggested change
r"<!--\s+date-check:\s+(\w+)\s+(\d+{4})\s+-->",
r"<!--\s+date-check\s+-->\s+(\w+)\s+(\d+{4})",
r"<!--\s+date-check:\s+(\w+)\s+(\d{4})\s+-->",
r"<!--\s+date-check\s+-->\s+(\w+)\s+(\d{4})",

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, could you combine these regexes into one to avoid all this complexity with making multiple passes? It might be a little more permissive wrt accepted input but I think it'd be better overall.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this with an earlier iteration, but it moved complexity elsewhere, where I had 4 regex groups (instead of just 2). Is that preferable, or is there a better alternative?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, it's not so bad 2a5b586

Comment on lines 44 to 48
let set = RegexSet::new(&patterns).unwrap();
set.patterns()
.iter()
.map(|pattern| Regex::new(pattern).unwrap())
.collect()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this usage of RegexSet do? It seems like has the same result as just returning vec![Regex::new(r1), Regex::new(r2)].

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a confused mess is what it is

ci/date-check/src/main.rs Outdated Show resolved Hide resolved
src/contributing.md Outdated Show resolved Hide resolved
Comment on lines 450 to 461
For the action to pick the date, add this annotation:

<!-- date-check -->

Example:

As of <!-- date-check --> Jul 2022, the foo did the bar.

For cases where the date should not be part of the visible rendered output,
use the following instead:

<!-- date-check: Jul 2022 -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could you use fenced code blocks and mark it as markdown?

@camelid camelid added S-waiting-on-author Status: this PR is waiting for additional action by the OP and removed S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content labels Jul 31, 2022
@tshepang
Copy link
Member Author

@camelid much wonderful review, thanks much... things are better as a result

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I left some suggestions to simplify the regex. After that, this looks great! Thanks for implementing this and writing so many tests.

ci/date-check/src/main.rs Outdated Show resolved Hide resolved
ci/date-check/src/main.rs Outdated Show resolved Hide resolved
tshepang and others added 3 commits August 2, 2022 05:38
Also, test new shape
Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you again! I really like this new version of date-check.

@camelid camelid merged commit 2557089 into rust-lang:master Aug 2, 2022
@tshepang tshepang deleted the lightweight branch August 2, 2022 21:04
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 17, 2022
Update books

## nomicon

2 commits in 8d1e4dccf71114ff56f328f671f2026d8e6b62a2..8e6aa3448515a0654e347b5e2510f1d4bc4d5a64
2022-07-18 18:12:35 -0400 to 2022-08-15 15:36:13 -0700
- Update the `repr(transparent)` section to reflect the current state (rust-lang/nomicon#376)
- [typo] typo on limits of lifetime chapter (rust-lang/nomicon#377)

## reference

5 commits in f3d3953bf3b158d596c96d55ce5366f9f3f972e9..e647eb102890e8927f488bea12672b079eff8d9d
2022-08-01 17:17:37 -0700 to 2022-08-16 11:35:27 -0700
- #[non_exhaustive] on variant blocks cross-crate as casts (rust-lang/reference#1249)
- Revert let chains reference docs (rust-lang/reference#1251)
- Update subtyping.md (rust-lang/reference#1240)
- a fix about .await (rust-lang/reference#1245)
- Be less specific about the representation of `+bundle` (rust-lang/reference#1246)

## book

2 commits in 36383b4da21dbd0a0781473bc8ad7ef0ed1b6751..42ca0ef484fcc8437a0682cee23abe4b7c407d52
2022-07-19 21:03:20 -0400 to 2022-08-12 21:52:02 -0400
- Missing period at end of sentence
- Fix grammar in ch06-02

## rust-by-example

8 commits in ee342dc91e1ba1bb1e1f1318f84bbe3bfac04798..03301f8ae55fa6f20f7ea152a517598e6db2cdb7
2022-07-27 11:06:36 -0300 to 2022-08-14 08:51:44 -0300
- Update print.md (rust-lang/rust-by-example#1597)
- in Meta, replace 'playpen' with 'playground' (rust-lang/rust-by-example#1596)
- Update doc comment to link to name field without compilation warning (rust-lang/rust-by-example#1595)
- add line numbers for playpen fixes rust-lang/rust-by-example#1593 (rust-lang/rust-by-example#1594)
- clarify that the map-reduce example relies on static data (rust-lang/rust-by-example#1592)
- Update flow_control.md (rust-lang/rust-by-example#1591)
- Remove duplicate line in the hello/print.md file (rust-lang/rust-by-example#1590)
- Make rust editable in chapter on defaults (rust-lang/rust-by-example#1589)

## rustc-dev-guide

15 commits in 04f3cf0..d3daa1f
2022-07-31 07:46:57 +0200 to 2022-08-13 10:00:38 +0900
- Improve the "Diagnostic items" chapter (rust-lang/rustc-dev-guide#1427)
- date-check: crates-io
- fix/improve compiler-debugging
- Update src/compiler-debugging.md
- add gdb tips for symbol-mangling-version
- move references down to avoid clutter (rust-lang/rustc-dev-guide#1420)
- update date-check format on github issue (rust-lang/rustc-dev-guide#1416)
- Fix legend colors in dark mode
- Add color for downloaded nodes
- Add colors to diagram
- Add bootstrapping diagram
- date-check: rustc_codegen_ssa is still alive
- note is now too old to be relevant
- date-check: be more strict
- make date-check more lightweight (rust-lang/rustc-dev-guide#1394)

## edition-guide

3 commits in c55611dd6c58bdeb52423b5c52fd0f3c93615ba8..6038be9d37d7251c966b486154af621d1794d7af
2022-02-21 14:21:39 +0100 to 2022-08-15 08:12:42 -0700
- use title "The Rust Edition Guide" everywhere (rust-lang/edition-guide#280)
- "Creating a new project": add example using 'cargo new --edition YEAR' (rust-lang/edition-guide#279)
- fixes rust-lang/edition-guide#277: mention rust 1.0 release month and year (rust-lang/edition-guide#278)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 17, 2022
Update books

## nomicon

2 commits in 8d1e4dccf71114ff56f328f671f2026d8e6b62a2..8e6aa3448515a0654e347b5e2510f1d4bc4d5a64
2022-07-18 18:12:35 -0400 to 2022-08-15 15:36:13 -0700
- Update the `repr(transparent)` section to reflect the current state (rust-lang/nomicon#376)
- [typo] typo on limits of lifetime chapter (rust-lang/nomicon#377)

## reference

5 commits in f3d3953bf3b158d596c96d55ce5366f9f3f972e9..e647eb102890e8927f488bea12672b079eff8d9d
2022-08-01 17:17:37 -0700 to 2022-08-16 11:35:27 -0700
- #[non_exhaustive] on variant blocks cross-crate as casts (rust-lang/reference#1249)
- Revert let chains reference docs (rust-lang/reference#1251)
- Update subtyping.md (rust-lang/reference#1240)
- a fix about .await (rust-lang/reference#1245)
- Be less specific about the representation of `+bundle` (rust-lang/reference#1246)

## book

2 commits in 36383b4da21dbd0a0781473bc8ad7ef0ed1b6751..42ca0ef484fcc8437a0682cee23abe4b7c407d52
2022-07-19 21:03:20 -0400 to 2022-08-12 21:52:02 -0400
- Missing period at end of sentence
- Fix grammar in ch06-02

## rust-by-example

8 commits in ee342dc91e1ba1bb1e1f1318f84bbe3bfac04798..03301f8ae55fa6f20f7ea152a517598e6db2cdb7
2022-07-27 11:06:36 -0300 to 2022-08-14 08:51:44 -0300
- Update print.md (rust-lang/rust-by-example#1597)
- in Meta, replace 'playpen' with 'playground' (rust-lang/rust-by-example#1596)
- Update doc comment to link to name field without compilation warning (rust-lang/rust-by-example#1595)
- add line numbers for playpen fixes rust-lang/rust-by-example#1593 (rust-lang/rust-by-example#1594)
- clarify that the map-reduce example relies on static data (rust-lang/rust-by-example#1592)
- Update flow_control.md (rust-lang/rust-by-example#1591)
- Remove duplicate line in the hello/print.md file (rust-lang/rust-by-example#1590)
- Make rust editable in chapter on defaults (rust-lang/rust-by-example#1589)

## rustc-dev-guide

15 commits in 04f3cf0..d3daa1f
2022-07-31 07:46:57 +0200 to 2022-08-13 10:00:38 +0900
- Improve the "Diagnostic items" chapter (rust-lang/rustc-dev-guide#1427)
- date-check: crates-io
- fix/improve compiler-debugging
- Update src/compiler-debugging.md
- add gdb tips for symbol-mangling-version
- move references down to avoid clutter (rust-lang/rustc-dev-guide#1420)
- update date-check format on github issue (rust-lang/rustc-dev-guide#1416)
- Fix legend colors in dark mode
- Add color for downloaded nodes
- Add colors to diagram
- Add bootstrapping diagram
- date-check: rustc_codegen_ssa is still alive
- note is now too old to be relevant
- date-check: be more strict
- make date-check more lightweight (rust-lang/rustc-dev-guide#1394)

## edition-guide

3 commits in c55611dd6c58bdeb52423b5c52fd0f3c93615ba8..6038be9d37d7251c966b486154af621d1794d7af
2022-02-21 14:21:39 +0100 to 2022-08-15 08:12:42 -0700
- use title "The Rust Edition Guide" everywhere (rust-lang/edition-guide#280)
- "Creating a new project": add example using 'cargo new --edition YEAR' (rust-lang/edition-guide#279)
- fixes rust-lang/edition-guide#277: mention rust 1.0 release month and year (rust-lang/edition-guide#278)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: this PR is waiting for additional action by the OP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants