mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +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.
|
||
|---|---|---|
| .. | ||
| commands | ||
| languages | ||
| meta_hooks | ||
| __init__.py | ||
| clientlib_test.py | ||
| color_test.py | ||
| conftest.py | ||
| envcontext_test.py | ||
| error_handler_test.py | ||
| git_test.py | ||
| lang_base_test.py | ||
| logging_handler_test.py | ||
| main_test.py | ||
| output_test.py | ||
| parse_shebang_test.py | ||
| prefix_test.py | ||
| repository_test.py | ||
| staged_files_only_test.py | ||
| store_test.py | ||
| util_test.py | ||
| xargs_test.py | ||
| yaml_rewrite_test.py | ||