mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.69k stars 273 forks source link

extend parsing instructions to use json object instead of plain txt #929

Closed mfederowicz closed 7 months ago

mfederowicz commented 8 months ago

related with #424

now we can use instead of txt format:

x = atomic.AddUint64(&x, 1) // MATCH /direct assignment to atomic value/

json format:

x = atomic.AddUint64(&x, 1) // json:{"MATCH": "direct assignment to atomic value","Confidence": 1}

of course this is only draft because I dont know how it should looks like logic to use all Failure properties, so I asume that for example we want to check if Confidence property have value equal to that setted up in json object, and if value is not equal then throw/log error otherwise everything is ok

this draft dont remove old MATH txt format, but add json feature, so we can use old format for some time :)

@chavacava what do you think about?

chavacava commented 8 months ago

Hi @mfederowicz, thank you for the PR (and sorry for the late response) I'll will take a look and come back to you ASAP

chavacava commented 7 months ago

Hi @mfederowicz, thanks for the feature. We will be able to test rules with more precision ;)