mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
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.
4 lines
78 B
YAML
4 lines
78 B
YAML
name: pre_commit_empty_pubspec
|
|
environment:
|
|
sdk: '>=2.12.0'
|
|
executables: {}
|