Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sslr-squid-bridge 2.7 #1484

Closed
guwirth opened this issue May 25, 2018 · 4 comments · Fixed by #2143
Closed

Use sslr-squid-bridge 2.7 #1484

guwirth opened this issue May 25, 2018 · 4 comments · Fixed by #2143
Assignees
Milestone

Comments

@guwirth
Copy link
Collaborator

guwirth commented May 25, 2018

Update sslr-squid-bridge to https://github.com/SonarSource/sslr-squid-bridge/releases/tag/2.7.0.377

@ivangalkin
Copy link
Contributor

Hi @guwirth

I tried to make a brief evaluation of the effort and came to conclusion, that the newest version of sslr-squid-bridge introduces a dramatic change. E.g. the commit SonarSource/sslr-squid-bridge@1e3819f#diff-04936be523283efb70cabd5beda0ef66

  • removes the base API: the packages org.sonar.squidbridge and org.sonar.squidbridge.api were wiped away. So e.g. the classes SquidAstVisitor, SquidAstVisitorContext, which all our visitors and even the preprocessor depend on, vanished now

  • base implementations for metrics (org.sonar.squidbridge.metrics) are deleted too: so classes CommentsVisitor, ComplexityVisitor, CounterVisitor, LinesVisitor are history now (used by CxxAstScanner)

  • base implementation for checks (org.sonar.squidbridge.checks) are deleted, which makes literally all cxx-checks/src/main/java/org/sonar/cxx/checks/*.java classes miss the SquidCheck interface (see how sonar-java solved that)... but also the classes for custom user-defined (!) checks are deleted too: AbstractCommentRegularExpressionCheck, AbstractXPathCheck etc

So IMHO there should be a step-by-step reduction of sslr-dependencies. Sonar-java went through this (see 1918 and 1940) but java plugin

  1. obviously doesn't need to have a preprocessor
  2. has an own AST and the visitors, which are independent from SSLR

I believe sonar-cxx should move in the same direction.

@guwirth
Copy link
Collaborator Author

guwirth commented Jun 9, 2018

Hi @ivangalkin,

thx for your investigation. Sounds that we have to stay on the current version or to do a bigger refactoring.

Regards,

@guwirth
Copy link
Collaborator Author

guwirth commented Dec 16, 2018

The python plugin is very close to ours. Think we should follow their approach:
https://github.com/SonarSource/sonar-python

@guwirth
Copy link
Collaborator Author

guwirth commented May 15, 2021

In the original version, some features were discontinued in subsequent versions, which will be further developed within the scope of this fork (#2143).

Instead of redeveloping everything ourselves, the solution with the fork seems simpler. In recent years, there were only a few changes in the original (mostly only parts were removed). The maintenance effort seems manageable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants