GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make Dart pre-commit hook compatible with the latest Dart SDKs by bc-lee · Pull Request #3507 · pre-commit/pre-commit

Conversation

@bc-lee

@bc-lee bc-lee commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

Dart introduced sound null safety in version 2.12.0, and as of Dart 3, null safety is mandatory. Older Dart SDKs allowed both pre-null safety and null-safe packages, but modern Dart SDKs, where most source code is null-safe, now reject pre-null safety packages.

The current pubspec.yaml template with sdk: '>=2.10.0' is incompatible with recent Dart SDKs, leading to the following error:

An unexpected error has occurred: CalledProcessError: command: ('/path/to/dart-sdk/bin/dart', 'pub', 'get') return code: 65
stdout:
    Resolving dependencies...
stderr:
    The lower bound of "sdk: '>=2.10.0'" must be 2.12.0'
    or higher to enable null safety.

    The current Dart SDK (3.8.3) only supports null safety.

    For details, see https://dart.dev/null-safety

To ensure compatibility with the modern Dart ecosystem, this commit updates the minimum Dart SDK version to 2.12.0 or higher, which implicitly supports null safety.
Additionally, testing/get-dart.sh has been updated to verify that the pre-commit hook functions correctly with the latest Dart versions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bc-lee added 2 commits August 8, 2025 17:14
@bc-lee
Make Dart pre-commit hook compatible with the latest Dart SDKs
f1cc7a4
Dart introduced sound null safety in version 2.12.0, and as of Dart 3,
null safety is mandatory. Older Dart SDKs allowed both pre-null safety
and null-safe packages, but modern Dart SDKs, where most source code is
null-safe, now reject pre-null safety packages.

The current `pubspec.yaml` template with `sdk: '>=2.10.0'` is
incompatible with recent Dart SDKs, leading to the following error:

An unexpected error has occurred: CalledProcessError: command: ('/path/to/dart-sdk/bin/dart', 'pub', 'get')
return code: 65
stdout:
    Resolving dependencies...
stderr:
    The lower bound of "sdk: '>=2.10.0'" must be 2.12.0'
    or higher to enable null safety.

    The current Dart SDK (3.8.3) only supports null safety.

    For details, see https://dart.dev/null-safety

To ensure compatibility with the modern Dart ecosystem, this commit
updates the minimum Dart SDK version to 2.12.0 or higher,
which implicitly supports null safety.
Additionally, `testing/get-dart.sh` has been updated to verify that
the pre-commit hook functions correctly with the latest Dart versions.
@bc-lee
Downgrade Dart SDK version installed in the CI
2a0bcea
asottile
asottile approved these changes Aug 9, 2025
View reviewed changes

@asottile asottile left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@asottile
asottile merged commit cc899de into pre-commit:main Aug 9, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 12, 2025
ECG Bot @tmeijn
build(deps): update pre-commit to v4.3.0
2caedcd
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [pre-commit](https://github.com/pre-commit/pre-commit) | minor | `4.2.0` -> `4.3.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>pre-commit/pre-commit (pre-commit)</summary>

### [`v4.3.0`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#430---2025-08-09)

[Compare Source](pre-commit/pre-commit@v4.2.0...v4.3.0)

\==================

##### Features

- `language: docker` / `language: docker_image`: detect rootless docker.
  - [#&#8203;3446](pre-commit/pre-commit#3446) MR by [@&#8203;matthewhughes934](https://github.com/matthewhughes934).
  - [#&#8203;1243](pre-commit/pre-commit#1243) issue by [@&#8203;dkolepp](https://github.com/dkolepp).
- `language: julia`: avoid `startup.jl` when executing hooks.
  - [#&#8203;3496](pre-commit/pre-commit#3496) MR by [@&#8203;ericphanson](https://github.com/ericphanson).
- `language: dart`: support latest dart versions which require a higher sdk
  lower bound.
  - [#&#8203;3507](pre-commit/pre-commit#3507) MR by [@&#8203;bc-lee](https://github.com/bc-lee).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS41OC4yIiwidXBkYXRlZEluVmVyIjoiNDEuNTguMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
@bc-lee
bc-lee deleted the dart-fix branch May 9, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@asottile asottile asottile approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@bc-lee @asottile
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.