openrewrite / rewrite-docs

Stores the markdown documents used to generate docs.openrewrite.org
https://docs.openrewrite.org
Apache License 2.0
41 stars 52 forks source link

Update bigdecimalrulesrecipes$bigdecimalvalueofrecipe.md #312

Closed al1lhomme closed 1 month ago

al1lhomme commented 1 month ago

add tag referencing sonar rule

What's changed?

i have add a tag section to reference the corresponding sonar rule

What's your motivation?

i was first searching this recipe by sonar rule reference, i dont find it and try other keywords

Anything in particular you'd like reviewers to focus on?

format is copied from https://docs.openrewrite.org/recipes/staticanalysis/writeoctalvaluesasdecimal#tags

timtebeek commented 1 month ago

hi @al1lhomme ! Thanks for looking to improve the docs. There's a a few indirections here:

  1. our docs are generated based on tags defined on recipes, so a change here would be overwritten next time we generate the docs
  2. these recipes are generated based on Refaster rules, which do support documentation, but don't yet support tags specifically
  3. the refaster rules that serve as input for these recipes are maintained by our friends at Picnic: https://error-prone.picnic.tech/refasterrules/BigDecimalRules/#bigdecimalvalueof

That means your change here would only temporarily feature in the docs if merged. But if you change the JavaDoc here to add a reference to that tag, then it should show after the next release makes it in here. I hope that helps!

timtebeek commented 1 month ago

Although interestingly there's also this Suppress warnings line on their template: https://github.com/PicnicSupermarket/error-prone-support/blob/9b4cbfb84dcebd9dbdd2235ca2b76675dfcb8f2e/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BigDecimalRules.java#L60

Perhaps we ought to pull that into our tags to show those in the docs; neat! Logged as a suggestion here: