-
Notifications
You must be signed in to change notification settings - Fork 6
Extreme make over #17
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
Conversation
…support newer attributes and are compatible with current sonarlint-cli implementation
…-java into fe/new-structure
README.md
Outdated
|
||
Copyright 2016-2017 SonarSource. | ||
|
||
Licensed under the [GNU Lesser General Public License, Version 3.0](http://www.gnu.org/licenses/lgpl.txt) |
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.
Shouldn't we keep a README.md
file?
NOTICE.txt
Outdated
mailto:info AT sonarsource DOT com | ||
|
||
This product includes software developed at | ||
SonarSource (http://www.sonarsource.com/). |
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.
I'm not sure of the licensing details but we may be required to keep this notice?
Makefile
Outdated
|
||
test: image | ||
docker run --rm -ti -w /usr/src/app -u root $(IMAGE_NAME) ./gradlew clean test | ||
|
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.
💄 extra line
} | ||
} else { | ||
lines.addProperty("begin", 1); | ||
lines.addProperty("end", 1); |
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.
Noting that this is not new, and was in the code before this PR
This seems a little risky. If we don't have a reliable location information for an issue, we probably shouldn't output it at all.
Do we know of issues that should apply generally to the file and not to a specific block of source code?
Wondering if we should just emit a warning here instead of emitting an issue with bad data.
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.
@dblandin Yeah, I am not very happy with this class either.
I am creating an gh-issue with these points and will address those in another PR, WTDY?
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.
Sounds good 👍
Would you mind commenting here with that issue link when it's available?
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.
JsonObject content = new JsonObject(); | ||
json.add("content", content); | ||
content.addProperty("body", ruleDetails.getHtmlDescription()); | ||
// // ruleDetails.getExtendedDescription(); |
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.
What does #getExtendedDescription
contain? Do we still need this comment?
} | ||
} | ||
} | ||
} |
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.
We can probably drop this generated file.
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.
This is fixture for testing.
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.
Ahh, cool cool 👍
Library classUnderTest = new Library(); | ||
assertTrue("someLibraryMethod should return 'true'", classUnderTest.someLibraryMethod()); | ||
} | ||
} |
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.
We can probably drop this generated file.
gradlew
Outdated
@@ -0,0 +1,172 @@ | |||
#!/usr/bin/env sh |
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.
Commented on the Dockerfile as well but I'm wondering if we can use the package manager for the gradle install instead of committing this script.
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package org.sonarlint.cli; |
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.
Is this the right package for this class? Should it com.codeclimate.engine
or something like that? Doesn't seem like it's meant to be part of sonarlint itself.
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.
Only put this here because of some package protected methods we need access.
Already working to improve this in another branch, if it is OK to leave it as is for now.
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.
Ahh, interesting. Yeah, in that case it's probably fine to leave as is. Would be great to minimize dependencies on protected methods in general.
import static org.sonarlint.cli.SonarProperties.PROJECT_HOME; | ||
|
||
|
||
public class CustomMain extends org.sonarlint.cli.Main { |
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.
I'm wondering if we can pick a better name than CustomMain
. Maybe Engine
if this is meant to be the engine wrapper around sonarlint?
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.
What about SonarlintWrapper
?
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.
Sure, that sounds good to me. Maybe even SonarlintEngineWrapper
to be more specific.
@dblandin Thanks for the feedbacks:
Appreciate another look at it if you have time! |
@filipesperandio Are there commits that haven't been pushed up yet? I still see references to |
d662d96
to
77c76a0
Compare
@dblandin My bad. Everything pushed now. |
/usr/src/app/dest/bin/sonarlint \ | ||
--src 'src/main/**/*.java' | ||
WORKDIR /code | ||
CMD cp -R /code /tmp/ && /usr/src/app/build/codeclimate-sonar /tmp/code |
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.
It looks like sonarlint supports a SONARLINT_USER_HOME
environment variable. Could that be used to redirect the tool's output to another directory, leaving the source code under analysis untouched in /code
?
SonarSource/sonarlint-core@220729b#diff-fc98b7a351de15143748ac690d4fc601
Trying to find a way to avoid this cp -R
workaround.
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.
@dblandin Didn't work. That reference seems outdated.
I think we can override it somewhere, but I would like to approach this in a separate PR as well. If it is OK for you?
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.
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.
Works for me 👍
I recommend reviewing by navigating the branch instead of looking at diffs as this is a complete new structure.
Related: qltysh/qlty#746