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

Bump dart_style from 2.3.7 to 3.0.0 #2459

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 9, 2024

Bumps dart_style from 2.3.7 to 3.0.0.

Release notes

Sourced from dart_style's releases.

package:dart_style v3.0.0

This is a large change. Under the hood, the formatter was almost completely rewritten, with the codebase now containing both the old and new implementations. The old formatter exists to support the older "short" style and the new code implements the new "tall" style.

The formatter uses the language version of the formatted code to determine which style you get. If the language version is 3.6 or lower, the code is formatted with the old style. If 3.7 or later, you get the new tall style. You typically control the language version by setting a min SDK constraint in your package's pubspec.

In addition to the new formatting style, a number of other API and CLI changes are included, some of them breaking:

  • Support project-wide page width configuration. By long request, you can now configure your preferred formatting page width on a project-wide basis. When formatting files, the formatter will look in the file's directory and any surrounding directories for an analysis_options.yaml file. If it finds one, it looks for the following YAML:

    formatter:
      page_width: 123

    If it finds a formatter key containing a map with a page_width key whose value is an integer, then that is the page width that the file is formatted using. Since the formatter will walk the surrounding directories until it finds an analysis_options.yaml file, this can be used to globally set the page width for an entire directory, package, or even collection of packages.

  • Support overriding the page width for a single file. In code formatted using the new tall style, you can use a special marker comment to control the page width that it's formatted using:

    // dart format width=30
    main() {
      someExpression +
          thatSplitsAt30;
    }

    This comment must appear before any code in the file and must match that

... (truncated)

Changelog

Sourced from dart_style's changelog.

3.0.0

This is a large change. Under the hood, the formatter was almost completely rewritten, with the codebase now containing both the old and new implementations. The old formatter exists to support the older "short" style and the new code implements the new "tall" style.

The formatter uses the language version of the formatted code to determine which style you get. If the language version is 3.6 or lower, the code is formatted with the old style. If 3.7 or later, you get the new tall style. You typically control the language version by setting a min SDK constraint in your package's pubspec.

In addition to the new formatting style, a number of other API and CLI changes are included, some of them breaking:

  • Support project-wide page width configuration. By long request, you can now configure your preferred formatting page width on a project-wide basis. When formatting files, the formatter will look in the file's directory and any surrounding directories for an analysis_options.yaml file. If it finds one, it looks for the following YAML:

    formatter:
      page_width: 123

    If it finds a formatter key containing a map with a page_width key whose value is an integer, then that is the page width that the file is formatted using. Since the formatter will walk the surrounding directories until it finds an analysis_options.yaml file, this can be used to globally set the page width for an entire directory, package, or even collection of packages.

  • Support overriding the page width for a single file. In code formatted using the new tall style, you can use a special marker comment to control the page width that it's formatted using:

    // dart format width=30
    main() {
      someExpression +
          thatSplitsAt30;
    }

    This comment must appear before any code in the file and must match that

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added Dart Issues particular to the pure Dart distribution dependencies Pull requests that update a dependency file labels Dec 9, 2024
@Goodwine
Copy link
Member

@dependabot rebase

@dependabot dependabot bot force-pushed the dependabot/pub/dart_style-3.0.0 branch from b21d3a7 to 54dfc45 Compare December 16, 2024 23:08
@Goodwine Goodwine requested a review from nex3 December 16, 2024 23:51
pubspec.yaml Outdated Show resolved Hide resolved
@jamesnw
Copy link
Contributor

jamesnw commented Dec 17, 2024

The Dartdoc failure appears to stem from an upgrade to dartdoc. It works on 8.3.0, and fails on 8.3.1.

Notably, 8.3.1 adds Sass compilation, which seems likely to be related.

Also impacting #2467.

@nex3
Copy link
Contributor

nex3 commented Dec 18, 2024

I've filed dart-lang/dartdoc#3948 to track this. In the meantime the easiest course of action is probably to limit Dartdoc to 8.3.0.

@Goodwine
Copy link
Member

@dependabot rebase

Copy link
Contributor Author

dependabot bot commented on behalf of github Dec 20, 2024

Looks like this PR has been edited by someone other than Dependabot. That means Dependabot can't rebase it - sorry!

If you're happy for Dependabot to recreate it from scratch, overwriting any edits, you can request @dependabot recreate.

dependabot bot and others added 3 commits December 20, 2024 02:56
Bumps [dart_style](https://github.com/dart-lang/dart_style) from 2.3.7 to 3.0.0.
- [Release notes](https://github.com/dart-lang/dart_style/releases)
- [Changelog](https://github.com/dart-lang/dart_style/blob/main/CHANGELOG.md)
- [Commits](dart-lang/dart_style@v2.3.7...v3.0.0)

---
updated-dependencies:
- dependency-name: dart_style
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
…nlyzer library because that analyzer library may use beta versions
@Goodwine Goodwine force-pushed the dependabot/pub/dart_style-3.0.0 branch from e3c8580 to adb872a Compare December 20, 2024 02:59
@Goodwine
Copy link
Member

Thanks for filing the bug and updating the broken dependency, @nex3 :)

PTAL, specifically how we now have to pass languageVersion.

Copy link
Contributor Author

dependabot bot commented on behalf of github Dec 23, 2024

A newer version of dart_style exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dart Issues particular to the pure Dart distribution dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants