pre-commit/pre_commit
Byoungchan Lee f1cc7a445f Make Dart pre-commit hook compatible with the latest Dart SDKs
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.
2025-08-08 17:14:59 +09:00
..
commands fix migrate-config for purelib yaml 2024-10-08 11:46:48 -04:00
languages Julia language: skip startup.jl file 2025-08-02 14:35:27 -04:00
meta_hooks python3.9+ 2023-10-28 14:20:37 -04:00
resources Make Dart pre-commit hook compatible with the latest Dart SDKs 2025-08-08 17:14:59 +09:00
__init__.py Initial commit. 2014-03-12 20:25:19 -07:00
__main__.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
all_languages.py Add support for julia hooks 2024-11-25 18:31:25 -05:00
clientlib.py add warning for deprecates stages for remote repos on init 2024-09-30 20:41:50 -04:00
color.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
constants.py make --hook-type and stages match 2023-03-11 14:26:14 -05:00
envcontext.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
error_handler.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
errors.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
file_lock.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
git.py fix: crash on ambiguous ref 'HEAD' 2025-03-15 15:23:15 -04:00
hook.py python3.9+ 2023-10-28 14:20:37 -04:00
lang_base.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
logging_handler.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
main.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-01-12 16:32:44 +00:00
output.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
parse_shebang.py python3.9+ 2023-10-28 14:20:37 -04:00
prefix.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
repository.py remove deprecated python_venv alias 2024-10-05 13:30:25 -04:00
staged_files_only.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
store.py add warning for deprecates stages for remote repos on init 2024-09-30 20:41:50 -04:00
util.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
xargs.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
yaml.py change migrate-config to use yaml parse tree instead 2024-09-16 20:16:16 -04:00
yaml_rewrite.py change migrate-config to use yaml parse tree instead 2024-09-16 20:16:16 -04:00