metacall / core

MetaCall: The ultimate polyglot programming experience.
https://metacall.io
Apache License 2.0
1.57k stars 161 forks source link

pre-commit-clang-format not working on windows #370

Open pkspyder007 opened 1 year ago

pkspyder007 commented 1 year ago

🐛 Bug Report

Fix pre-commit-clang-format git hook to detect clang on windows and add v15 to the major version list.

Expected Behavior

Current Behavior

Clang-format is not detected even being installed already image

image

Possible Solution

For adding v15 just add it to the this line https://github.com/metacall/core/blob/develop/githooks/pre-commit-clang-format#L27

Regarding the hook not detecting the clang-format executable, the current script is in bash if it could be ported to a .bat or .ps1 script for windows.

giarve commented 1 year ago

Worth keeping up to date with https://github.com/godotengine/godot/blob/master/misc/hooks/pre-commit-clang-format,

as they already solved adding v15.

viferga commented 1 year ago

Also making the script polyglot should be a nice option too: https://gist.github.com/prail/24acc95908e581722c0e9df5795180f6

Coder-Manan commented 1 year ago

Will porting the bash script to .ps1 or .bat fix the issue?

pkspyder007 commented 1 year ago

@Coder-Manan check this out https://github.com/metacall/core/issues/370#issuecomment-1385671085 @giarve can answer this better

parteekcoder commented 1 year ago

@viferga is this issue solved or not ? if not please assign it to me

viferga commented 1 year ago

It is not resolved, try to port the bash script to ps1 or bat, then we will add a polyglot launcher to make it work in mac/linux and windows, as suggested in the issue.

viferga commented 1 year ago

Will porting the bash script to .ps1 or .bat fix the issue?

Yes, but we will need to add a common launcher for multiple platforms.

viferga commented 1 year ago

@parteekcoder I am not going to assign this to anybody, feel free to PR it if you want, and I will close the issue, this is open to anybody to be resolved.

Samir433 commented 1 year ago

is this issue solved or not ? if not please assign it to me

pkspyder007 commented 1 year ago

@Samir433 you can work on it if you want. If your solution is good we'll merge it. https://github.com/metacall/core/issues/370#issuecomment-1414567847

Coder-Manan commented 1 year ago

in the find_clang_format function should I check only for versions 11-15 or for any version >= 11? (I am porting the script to ps script)

adityathapa009 commented 7 months ago

for windows repos:

Jatin00001 commented 6 months ago

If the issue remains unresolved, kindly delegate it to me for further attention and resolution.