fsprojects / FSharpLint

Lint tool for F#
https://fsprojects.github.io/FSharpLint/
MIT License
303 stars 73 forks source link

Printing version #612

Closed Thorium closed 10 months ago

Thorium commented 10 months ago

This will add --version argument for printing version, with GitHub commit-id e.g. "1.0.0+2cfaef9576731e7852852518b730349341b069d9"

Fix for #611

knocte commented 10 months ago

Hey @Thorium thanks for your PR! Looks good in principle, just gonna point out some nits.

Thorium commented 10 months ago

Hey @Thorium thanks for your PR! Looks good in principle, just gonna point out some nits.

Done.

knocte commented 10 months ago

So I assume you tested your own PR? Just making sure, because it's very surprising to me that you can get the commit hash out of some reflection API.

Thorium commented 10 months ago

I originally took the code from Paket repository, and that is used a lot :-)

Thorium commented 10 months ago

This codebase is using Paket, I think that puts commit hash to AssemblyInfo style attributes.

Numpsy commented 10 months ago

The binaries are sourcelinked, and the sourcelink tools can insert the git commit info into the assembly version information.

knocte commented 10 months ago

This codebase is using Paket, I think that puts commit hash to AssemblyInfo style attributes.

It uses Paket to restore, I doubt it uses Paket to pack, because it is Fake the tool that is packing, right? See https://github.com/fsprojects/FSharpLint/blob/master/build.fsx#L124

The binaries are sourcelinked, and the sourcelink tools can insert the git commit info into the assembly version information.

Oh interesting! I guess I missed the commit that introduced SourceLink support, must be old (before I became maintainer); will investigate.