question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: make language_version more intuitive or create minimum_language_version

See original GitHub issue

Please consider the situation below:

Hook creator knows that the hook cannot run on Python 2. The creator adds language_version: python3 to the hook definition.

User has two Python 3 versions installed: Python 3.9 and Python 3.10. Python 3.9 is the system default, but the user wants to run all hooks with Python 3.10. The user specifies default_language_version to python3.10.

Hook runs on python3.9, because currently language_version causes default_language_version to be completely ignored.

Proposal:

If the default_language_version matches language_version, use the one that is more specific. In the case above it would be default_language_version.

Example:

language_version set to python3

default_language_version set to python3.10

Expected result:

Run hook with python3.10 because default_language_version matches language_version. Do not run with python3.9 or any other version that does not match both language_version and default_language_version.

Example:

language_version set to python3.10

default_language_version set to python3.10.2

Expected result:

Run hook with python3.10.2 because default_language_version matches language_version. Do not run with python3.10.1 or any other version that does not match both language_version and default_language_version.

Example:

language_version set to python3.7

default_language_version set to python3.10

Expected result:

Run hook with python3.7 because default_language_version does not match language_version.

Another way that this issue could be solved:

Create minimum_language_version parameter that will indicate minimum language version and let hook creators use it instead of language_version for such cases.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Dec 12, 2022

version parsing for pre-commit versions is trivial because I control the version string

version parsing for version strings which are passed to arbitrary third party tools is intractable and trying to do so would be error prone, complicated, and confusing to end users

0reactions
asottilecommented, Dec 14, 2022

yeah again, not happening as decided before. please stop re litigating prior decisions

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Review] SE-0181: Package Manager C/C++ Language ...
Hello Swift community, The review of SE-0181: Package Manager C/C++ Language Standard Support begins now and runs through July 14th, 2017. The proposal...
Read more >
Unable to compile C# 7.1 code on VSTS build agents #21783
Please use language version 7.1 or greater. Adding Roslyn compilers package does not fix this. Same error. Notes: First attempt on build ...
Read more >
How to enable Nullable Reference Types feature of C# 8.0 for ...
Open up the project file in a text editor and make the following changes: ... You must explicitly set the language version to...
Read more >
Announcing F# 4.7 - .NET Blog
The lowest-supported language version is F# 4.6. We do not plan on retrofitting language version support for F# 4.5 and lower.
Read more >
Improving Scala 3 forward compatibility - Compiler
We propose that the compiler should accept the flag --scala-target that accepts the Scala version as an argument.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found