pre-commit requires preview sdk
See original GitHub issueReproduce steps:
- Make sure there is no net6-preview sdk installed globally
- Use following
.pre-commit-config.yaml
repos:
- repo: https://github.com/dotnet/format
rev: "v5.1.225507" # Specify a tag or sha here, or run "pre-commit autoupdate"
hooks:
- id: dotnet-format
- Type
pre-commit run
Expected result:
Everything fine
Actual result:
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
* You intended to execute a .NET program:
The application 'pack' does not exist.
* You intended to execute a .NET SDK command:
A compatible installed .NET SDK for global.json version [6.0.100-preview.1.21103.13] from [C:\Users\leo\.cache\pre-commit\repo5e5uh95j\global.json] was not found.
Install the [6.0.100-preview.1.21103.13] .NET SDK or update [C:\Users\leo\.cache\pre-commit\repo5e5uh95j\global.json] with an installed .NET SDK:
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
pre-commit
Before you can run hooks, you need to have the pre-commit package manager installed. Using pip: pip install pre-commit. In a python project,...
Read more >How can I enforce black's `--preview` option when invoking ...
0, in a Python 3.9.9 venv). Now I'd like to make sure that enforcement happens with every commit, using pre-commit, but I don't...
Read more >Supported hooks
check-autopkg-recipe-list - This hook checks AutoPkg recipe lists (in txt, plist, yaml, or json format) for common issues. check-autopkg-recipes - This hook ...
Read more >Pre-commit | GitGuardian documentation
ggshield is a wrapper around GitGuardian API for secrets detection that requires an API key to work. Preview#. pre-commit preview. Installation#. The pre-commit...
Read more >Pre-push | GitGuardian documentation
... GitGuardian API for secrets detection that requires an API key to work. ... pre-push preview ... Make sure you have the pre-commit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After investigation, another option will be just use pre-commit “local” mode to use dotnet format installed as local tool / part of sdk and skip downloading at all.
I’ll update integrations.md with info about this option. PR will follow 😃
Hi @leotsarev, You seem to have run into the same issue as https://github.com/dotnet/format/issues/1318.
I agree. I thought it was an interesting choice to build our tool locally when running pre-commit. We welcome pull requests to make this experience better.