-
Notifications
You must be signed in to change notification settings - Fork 6
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
Clean-up and tweaks of the firehose project. #117
Conversation
@@ -4,69 +4,64 @@ | |||
|
|||
import 'dart:io'; | |||
|
|||
import 'package:collection/collection.dart'; | |||
|
|||
class Changelog { |
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.
This entire class can be optimized to not read the file from scratch on every operation.
Unless it's deliberately doing it to avoid using stale data, it probably should cache the List<String>
lines and/or List<_Section>
sections.
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 suspect that worrying about stale data was not a use-case here; some simple caching seems reasonable.
return null; | ||
} | ||
|
||
String? get latestHeading { | ||
var sections = _parseSections(); | ||
// Remove all leading "#" | ||
return sections.firstOrNull?.title.replaceAll(RegExp(r'^#*'), '').trim(); |
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.
The only lines we accept below as title lines start with ##
, so it's overkille to match any number of #
s here.
.transform(const LineSplitter()) | ||
.listen((line) => stderr | ||
..write(' ') | ||
..writeln(line)); |
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.
Just don't allocate extra strings unnecessarily.
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.
Thanks for the PR! We'll need to fix a test - make sure the regex is covering what we expect. And merging main into this PR should address the mono_repo related failure.
@@ -4,69 +4,64 @@ | |||
|
|||
import 'dart:io'; | |||
|
|||
import 'package:collection/collection.dart'; | |||
|
|||
class Changelog { |
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 suspect that worrying about stale data was not a use-case here; some simple caching seems reasonable.
Cleaned up and reduced RegExp use. Simplified some functions. Upped SDK constraint to 3.0.0, to use `firstOrNull` from SDK.
PR HealthPackage publish validation ✔️Details
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. License Headers ✔️Details
All source files should start with a license header. Changelog Entry ✔️Details
Changes to files need to be accounted for in their respective changelogs. |
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
Merged to head of main. |
Always document what a RegExp matches in prose. They are *not* readable.
Sorry, for "We'll need to fix a test - make sure the regex is covering what we expect", I meant that the regex change was breaking a test; it looks like the test is no longer failing though. |
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.
Feel free to publish this (via the automation link) after the PR lands.
Super, thanks. |
Just tagging the commit (w/ the well-formed tag, as listed in #117 (comment)) works. However the general process is to create a github release, which also creates a tag. And, mush of that is automated - the hyperlink from the above takes you to the releases page w/ all the info for the release filled out (the name, releases notes, and tag to use). Docs are here:https://github.com/dart-lang/ecosystem/wiki/Publishing-automation (but should be updated to mention the link that firehose creates). |
Cleaned up and reduced RegExp use.
Simplified some functions.
Upped SDK constraint to 3.0.0, to use
firstOrNull
from SDK.