mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14: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.
|
||
|---|---|---|
| .. | ||
| commands | ||
| languages | ||
| meta_hooks | ||
| resources | ||
| __init__.py | ||
| __main__.py | ||
| all_languages.py | ||
| clientlib.py | ||
| color.py | ||
| constants.py | ||
| envcontext.py | ||
| error_handler.py | ||
| errors.py | ||
| file_lock.py | ||
| git.py | ||
| hook.py | ||
| lang_base.py | ||
| logging_handler.py | ||
| main.py | ||
| output.py | ||
| parse_shebang.py | ||
| prefix.py | ||
| repository.py | ||
| staged_files_only.py | ||
| store.py | ||
| util.py | ||
| xargs.py | ||
| yaml.py | ||
| yaml_rewrite.py | ||