-
Notifications
You must be signed in to change notification settings - Fork 8
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
Remove sorting of allowedHelp maps #852
Conversation
Closes #845 It is idiomatic to treat the key order of a Dart map as meaningful given that map literals and default Map type preserve key insertion order. It is more useful to allow the caller to decide this order than to mandate an alpha sorting by key. Callers which need this order can construct the map appropriately, and callers which prefer a different order now have the capability. Releasing as a non-breaking change since specific usage output is considered an implementation detail. This is expected to impact some CI statuf for packages with tests hardcoding a strict dependency on the output. No additional tests are necessary since updating the order in existing tests demonstrates the same behavior as adding a non-sorting specific test.
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR Health
Breaking changes
|
Package | Change | Current Version | New Version | Needed Version | Looking good? |
---|---|---|---|---|---|
args | Non-Breaking | 2.6.0 | 2.6.1-wip | 2.7.0 Got "2.6.1-wip" expected >= "2.7.0" (non-breaking changes) |
This check can be disabled by tagging the PR with skip-breaking-check
.
Changelog Entry ✔️
Package | Changed Files |
---|
Changes to files need to be accounted for in their respective changelogs.
Coverage ⚠️
File | Coverage |
---|---|
pkgs/args/lib/src/arg_parser.dart | 💚 94 % |
pkgs/args/lib/src/usage.dart | 💔 99 % ⬇️ 0 % |
This check for test coverage is informational (issues shown here will not fail the PR).
This check can be disabled by tagging the PR with skip-coverage-check
.
API leaks ✔️
The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
Package | Leaked API symbols |
---|
License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files |
---|
no missing headers |
All source files should start with a license header.
pkgs/args/lib/src/usage.dart
Outdated
_newline(); | ||
for (var name in allowedNames) { | ||
for (var name in option.allowedHelp!.keys) { |
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.
nit: consider an if case to extract this as a variable and avoid the !
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.
Done, did a couple nearby ones as well.
Closes #845
It is idiomatic to treat the key order of a Dart map as meaningful
given that map literals and default Map type preserve key insertion
order. It is more useful to allow the caller to decide this order than
to mandate an alpha sorting by key. Callers which need this order can
construct the map appropriately, and callers which prefer a different
order now have the capability.
Remove the additional list copy and iterate the map keys directly.
Releasing as a non-breaking change since specific usage output is
considered an implementation detail. This is expected to impact some CI
statuf for packages with tests hardcoding a strict dependency on the
output.
No additional tests are necessary since updating the order in existing
tests demonstrates the same behavior as adding a non-sorting specific
test.