This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
WIP Refactor generating rules and rule repositories #378
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BalmungSan
reviewed
Feb 18, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool.
Maybe the generator could / should be moved to another module? But probably just too much extra work for just not including it in the sonar-scala.jar
src/main/scala/com/mwz/sonar/scala/metadata/scalastyle/ScalastyleRulesRepository.scala
Outdated
Show resolved
Hide resolved
I thought about it doing it and It's not a big deal thb - I might still do it, but it's not the end of the world if this little app gets bundled into the same artifact. |
It looks like I don't need to declare anything new in the context, I think this is ready to be merged. |
BalmungSan
approved these changes
Feb 19, 2020
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors how rules and rule repositories are generated.
My goal is to be able to export the collection of all of our raw rules (as they get generated directly from Scalastyle and Scapegoat) and the rule repositories and quality profiles that get created by sonar-scala at runtime. I want to be able to export all of that data into a json file, which I can then use in a separate user interface embedded on sonar-scala.com website, as described in #343.
In order to do that, I created a new package
metadata
, which will contain (in an intermediate data format) all of the rules, repositories and quality profiles. This data is then going to be used toSo far I've refactored Scalastyle's rule repository to use this new mechanism and I still have Scapegoat and all the quality profiles left to do. I don't think I want to create a massive PR with all the changes in it, so as long as it's in a working state, I will refactor this functionality incrementally, e.g. Scalastyle quality profile next, then Scapegoat rules repo, quality profile and then all the other quality profiles.
I still need to add some of the new files to the plugin context, so that SonarQube doesn't blow up at runtime.
Relates to #343.