forked from lwg/issues
-
Notifications
You must be signed in to change notification settings - Fork 34
Concurrency for issue generation #536
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
Open
jwakely
wants to merge
3
commits into
cplusplus:master
Choose a base branch
from
jwakely:concurrency
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,16 +146,6 @@ auto to_string(major_section_key sn) -> std::string { | |
| return out.str(); | ||
| } | ||
|
|
||
| template<typename Container> | ||
| void print_list(std::ostream & out, Container const & source, char const * separator) { | ||
| char const * sep{""}; | ||
| for (auto const & x : source) { | ||
| out << sep << x; | ||
| sep = separator; | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
| void print_file_header(std::ostream& out, std::string const & title, std::string url_filename = {}, std::string desc = {}) { | ||
| out << | ||
|
|
@@ -301,7 +291,11 @@ R"(<table class="issues-index"> | |
|
|
||
| // Duplicates | ||
| out << "<td>"; | ||
| print_list(out, i.duplicates, ", "); | ||
| char const* sep = ""; | ||
| for (auto const& x : i.duplicates) { | ||
| out << sep << x.second; | ||
| sep = ", "; | ||
| } | ||
| out << "</td>\n" | ||
| << "</tr>\n"; | ||
| } | ||
|
|
@@ -380,7 +374,11 @@ void print_issue(std::ostream & out, lwg::issue const & iss, lwg::section_map & | |
| // duplicates | ||
| if (!iss.duplicates.empty()) { | ||
| out << "<p><b>Duplicate of:</b> "; | ||
| print_list(out, iss.duplicates, ", "); | ||
| char const* sep = ""; | ||
| for (auto const& x : iss.duplicates) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dito here? |
||
| out << sep << x.second; | ||
| sep = ", "; | ||
| } | ||
| out << "</p>\n"; | ||
| } | ||
|
|
||
|
|
@@ -479,7 +477,7 @@ namespace lwg | |
| // A precondition for calling any of these functions is that the list of issues is sorted in numerical order, by issue number. | ||
| // While nothing disastrous will happen if this precondition is violated, the published issues list will list items | ||
| // in the wrong order. | ||
| void report_generator::make_active(std::span<const issue> issues, fs::path const & path, std::string const & diff_report) { | ||
| void report_generator::make_active(std::span<const issue> issues, fs::path const & path, std::string const & diff_report) const { | ||
| assert(std::ranges::is_sorted(issues, {}, &issue::num)); | ||
|
|
||
| fs::path filename{path / "lwg-active.html"}; | ||
|
|
@@ -498,7 +496,7 @@ void report_generator::make_active(std::span<const issue> issues, fs::path const | |
| } | ||
|
|
||
|
|
||
| void report_generator::make_defect(std::span<const issue> issues, fs::path const & path, std::string const & diff_report) { | ||
| void report_generator::make_defect(std::span<const issue> issues, fs::path const & path, std::string const & diff_report) const { | ||
| assert(std::ranges::is_sorted(issues, {}, &issue::num)); | ||
|
|
||
| fs::path filename{path / "lwg-defects.html"}; | ||
|
|
@@ -516,7 +514,7 @@ void report_generator::make_defect(std::span<const issue> issues, fs::path const | |
| } | ||
|
|
||
|
|
||
| void report_generator::make_closed(std::span<const issue> issues, fs::path const & path, std::string const & diff_report) { | ||
| void report_generator::make_closed(std::span<const issue> issues, fs::path const & path, std::string const & diff_report) const { | ||
| assert(std::ranges::is_sorted(issues, {}, &issue::num)); | ||
|
|
||
| fs::path filename{path / "lwg-closed.html"}; | ||
|
|
@@ -535,7 +533,7 @@ void report_generator::make_closed(std::span<const issue> issues, fs::path const | |
|
|
||
|
|
||
| // Additional non-standard documents, useful for running LWG meetings | ||
| void report_generator::make_tentative(std::span<const issue> issues, fs::path const & path) { | ||
| void report_generator::make_tentative(std::span<const issue> issues, fs::path const & path) const { | ||
| // publish a document listing all tentative issues that may be acted on during a meeting. | ||
| assert(std::ranges::is_sorted(issues, {}, &issue::num)); | ||
|
|
||
|
|
@@ -555,7 +553,7 @@ void report_generator::make_tentative(std::span<const issue> issues, fs::path co | |
| } | ||
|
|
||
|
|
||
| void report_generator::make_unresolved(std::span<const issue> issues, fs::path const & path) { | ||
| void report_generator::make_unresolved(std::span<const issue> issues, fs::path const & path) const { | ||
| // publish a document listing all non-tentative, non-ready issues that must be reviewed during a meeting. | ||
| assert(std::ranges::is_sorted(issues, {}, &issue::num)); | ||
|
|
||
|
|
@@ -574,7 +572,7 @@ void report_generator::make_unresolved(std::span<const issue> issues, fs::path c | |
| print_file_trailer(out); | ||
| } | ||
|
|
||
| void report_generator::make_immediate(std::span<const issue> issues, fs::path const & path) { | ||
| void report_generator::make_immediate(std::span<const issue> issues, fs::path const & path) const { | ||
| // publish a document listing all non-tentative, non-ready issues that must be reviewed during a meeting. | ||
| assert(std::ranges::is_sorted(issues, {}, &issue::num)); | ||
|
|
||
|
|
@@ -609,7 +607,7 @@ out << R"(<h1>C++ Standard Library Issues Resolved Directly In [INSERT CURRENT M | |
| print_file_trailer(out); | ||
| } | ||
|
|
||
| void report_generator::make_ready(std::span<const issue> issues, fs::path const & path) { | ||
| void report_generator::make_ready(std::span<const issue> issues, fs::path const & path) const { | ||
| // publish a document listing all ready issues for a formal vote | ||
| assert(std::ranges::is_sorted(issues, {}, &issue::num)); | ||
|
|
||
|
|
@@ -644,7 +642,7 @@ out << R"(<h1>C++ Standard Library Issues to be moved in [INSERT CURRENT MEETING | |
| print_file_trailer(out); | ||
| } | ||
|
|
||
| void report_generator::make_editors_issues(std::span<const issue> issues, fs::path const & path) { | ||
| void report_generator::make_editors_issues(std::span<const issue> issues, fs::path const & path) const { | ||
| // publish a single document listing all 'Voting' and 'Immediate' resolutions (only). | ||
| assert(std::ranges::is_sorted(issues, {}, &issue::num)); | ||
|
|
||
|
|
@@ -659,7 +657,7 @@ void report_generator::make_editors_issues(std::span<const issue> issues, fs::pa | |
| print_file_trailer(out); | ||
| } | ||
|
|
||
| void report_generator::make_sort_by_num(std::span<issue> issues, fs::path const & filename) { | ||
| void report_generator::make_sort_by_num(std::span<issue> issues, fs::path const & filename) const { | ||
| std::ranges::sort(issues, {}, &issue::num); | ||
|
|
||
| std::ofstream out{filename}; | ||
|
|
@@ -749,7 +747,7 @@ sorted by priority.</p> | |
| print_file_trailer(out); | ||
| } | ||
|
|
||
| void report_generator::make_sort_by_status_impl(std::span<issue> issues, fs::path const & filename, std::string title) { | ||
| void report_generator::make_sort_by_status_impl(std::span<issue> issues, fs::path const & filename, std::string title) const { | ||
| std::ofstream out{filename}; | ||
| if (!out) | ||
| throw std::runtime_error{"Failed to open " + filename.string()}; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What about tacking advantage of for-range loop with initializer to reduce the scope of sep?