pre-commit/pre_commit/languages
Rodney, Tiara 0d50ffc2b7
refactor(languages/node): adapt scripts path resolution
Cygwin isn't the only edge-case for a differing bin/ path. In addition there
also is MSYS2, which behaves differently than Cygwin. CPython compiled against
Microsoft Visual C++ Runtime (MSVCRT) through MinGW, will correctly identify as
an 'nt' platform, yet will prefer a POSIX path scheme.

In order to avoid having to patch every edge-case, we can spy on the system
configurations install paths through the `sysconfig` module and get the basename
of the global scripts path, which will be returned in accordance with the
preferred install path scheme of the system/platform.

Fixes: https://github.com/pre-commit/pre-commit/issues/3448
2025-04-15 16:05:08 +02:00
..
__init__.py OMG we're running a hook 2014-03-13 22:12:33 -07:00
conda.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
coursier.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
dart.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
docker.py give docker a tty output when expecting color 2024-03-02 11:51:34 -05:00
docker_image.py give docker a tty output when expecting color 2024-03-02 11:51:34 -05:00
dotnet.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
fail.py python3.9+ 2023-10-28 14:20:37 -04:00
golang.py disable automatic toolchain switching for golang hooks 2024-11-25 18:47:18 -05:00
haskell.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
julia.py Add support for julia hooks 2024-11-25 18:31:25 -05:00
lua.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
node.py refactor(languages/node): adapt scripts path resolution 2025-04-15 16:05:08 +02:00
perl.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
pygrep.py python3.9+ 2023-10-28 14:20:37 -04:00
python.py refactor(languages/python): adapt scripts path resolution 2025-04-15 16:04:46 +02:00
r.py fix: ensure env patch is applied for vanilla emulation 2025-01-20 13:13:36 -05:00
ruby.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
rust.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
script.py python3.9+ 2023-10-28 14:20:37 -04:00
swift.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-29 21:59:19 +00:00
system.py move languages.all and languages.helpers out of languages 2023-02-20 18:03:45 -05:00