Cuba
(Libra)
November 11, 2022, 2:49am
1
Hi!
According to this Ruby 3.1 hash syntax not supported with SQScanner which points to SONARSLANG-556 recent scanner versions should support Ruby 3.1 but it doesn’t look like the case.
I am running sonar-scanner-4.7.0.2747-linux against Ruby 3.1 codebase and it is unable to scan constructions like
::ActiveSupport::JSON.encode({
status: status.to_s,
errors: [{
status: status.to_s,
title:,
detail:,
}]
})
response_from_auth_service(
method: :get,
path: '/exchange',
headers:,
cookie:
)
render json: encode_error(exc, status:), status:
Each ends with (SyntaxError) unexpected token tCOMMA
As well as
def subscribe(*args, &)
provider_class.subscribe(*args, &)
end
Which leads to (SyntaxError) unexpected token tRPAREN
So it looks it is not read as this syntax is perfectly valid and passes ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
syntax checks.
1 Like
ganncamp
(G Ann Campbell)
November 14, 2022, 8:27pm
2
Hi,
What version of SonarQube are you using? You can check the page footer if you’re not sure.
Ann
Cuba
(Libra)
November 14, 2022, 8:28pm
4
Hi,
I am using Enterprise Edition Version 8.9.6 (build 50800)
ganncamp
(G Ann Campbell)
November 14, 2022, 8:29pm
5
Hi,
Support for Ruby 3.1 was added in SonarQube 9.6. Note that the current version is 9.7.1, so if you’re going to upgrade, you might as well go all the way.
Ann
Cuba
(Libra)
November 14, 2022, 8:32pm
6
Oh, okay… I was thinking the scanner should be able to parse it before sending to backend, while the server will either mark them as a “Code Smell” or as an error (which is happening right now) if it doesn’t support.
Good to know that scanner doesn’t play a role here.
Thanks for clarification!
1 Like
Cuba
(Libra)
November 15, 2022, 9:51pm
7
Ha, I just realized that the Sonarqube 8.9 is the LTS version. So, upgrade is not without a drawbacks.
Any idea when 9.6+ will be moved to LTS?
Cuba
(Libra)
November 15, 2022, 9:58pm
8
8.9 was initially released in May, 21. With a lifecycle of 18 months, the new version should be released this or the next month, isn’t it?
ganncamp
(G Ann Campbell)
November 16, 2022, 3:17pm
9
Hi,
9.6 will never be “moved” to LTS. When we release LTS versions, they are released as LTS. And BTW, the current version is 9.7.1. The LTS is expected in 2023Q1.
Ehm… I’m not sure about drawbacks. It does come with great rewards. Including support of Ruby 3.1.
Ann
Cuba
(Libra)
November 16, 2022, 10:59pm
10
Obviously the upgrade cycle which is every 2 months instead of 18. Also stability and less unexpected changes.
system
(system)
Closed
November 23, 2022, 10:59pm
11
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
Colin
(Colin)
December 19, 2022, 4:17pm
12
Hey @Cuba
SonarQube v9.9 LTS will be released in February! More info here:
We’ve accomplished a lot in SonarQube’s 9-series, and we’ll put a bow on it with the February 7th delivery of SonarQube 9.9 LTS.
What features are you most looking forward to in the new LTS?
Faster PR analysis ( )
Reporting
IaC analysis & mobile security
Better authentication, token security & user management
Language features like Java 17, C++20, C# 10
Something else
Let us know what makes you eager to upgrade (assuming you’re not already on the latest version) and he…