-
Notifications
You must be signed in to change notification settings - Fork 176
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
support 6.7 LTS #840
support 6.7 LTS #840
Conversation
4191fe1
to
32aac6e
Compare
6b17a21
to
f6f5e12
Compare
Collection<File> files = StreamSupport.stream(inputFiles.spliterator(), false) | ||
.map(CompatibleInputFile::file) | ||
.map(InputFile::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.
} catch (IOException e) { | ||
throw Throwables.propagate(e); | ||
} | ||
} | ||
|
||
private static Settings settings() { | ||
Settings settings = new MapSettings(); | ||
private static Configuration config() { |
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.
@vilchik-elena just a question: this kind of change is not related to dropping old versions support, it's about preparing for future removals of currently deprecated code, right?
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.
@inverno mostly yes (while note, that MapSettings
changed its package)
.defaultValue(LCOV_REPORT_PATHS_DEFAULT_VALUE) | ||
.name("LCOV Files") | ||
.description("Paths (absolute or relative) to the files with LCOV data.") | ||
.onQualifiers(Qualifiers.MODULE, Qualifiers.PROJECT) |
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.
@vilchik-elena add multivalues
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.
fixed
.subCategory(TEST_AND_COVERAGE) | ||
.category(JAVASCRIPT_CATEGORY) | ||
.build(), | ||
|
||
PropertyDefinition.builder(FILE_SUFFIXES_KEY) | ||
.defaultValue(FILE_SUFFIXES_DEFVALUE) | ||
.name("File Suffixes") | ||
.description("Comma-separated list of suffixes for files to analyze.") |
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.
@vilchik-elena maybe drop Comma-separated here as well
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.
fixed
@@ -177,13 +162,13 @@ private void analyse(SensorContext sensorContext, CompatibleInputFile inputFile, | |||
scanFile(sensorContext, inputFile, executor, visitors, scriptTree); | |||
} catch (RecognitionException e) { | |||
checkInterrupted(e); | |||
LOG.error("Unable to parse file: " + inputFile.absolutePath()); | |||
LOG.error("Unable to parse file: " + inputFile.toString()); |
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.
@vilchik-elena I would use inputFile.uri()
. It might be more stable than toString
and it is absolute, as before, unlike the current implementation of DefaultInputFile.toString()
which is using the project-relative path. Unless the goal was to use the project-relative path, in which case we should use InputFile.getProjectRelativePath()
.
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.
done
LOG.error(e.getMessage()); | ||
processRecognitionException(e, sensorContext, inputFile); | ||
} catch (Exception e) { | ||
checkInterrupted(e); | ||
processException(e, sensorContext, inputFile); | ||
LOG.error("Unable to analyse file: " + inputFile.absolutePath(), e); | ||
LOG.error("Unable to analyse file: " + inputFile.toString(), e); |
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.
@vilchik-elena same as above
boolean isMinified = new MinificationAssessor().isMinified(file); | ||
if (isMinified) { | ||
LOG.debug("File [" + file.absolutePath() + "] looks like a minified file and will not be analyzed"); | ||
LOG.debug("File [" + file.toString() + "] looks like a minified file and will not be analyzed"); |
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.
@vilchik-elena same
@@ -35,17 +35,10 @@ | |||
/** | |||
* @return the current file | |||
*/ | |||
JavaScriptFile getJavaScriptFile(); | |||
InputFile getJavaScriptFile(); |
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.
@vilchik-elena JavaScriptFile -> InputFile ?
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.
Done
createSensor().analyseFiles(context, ImmutableList.of((TreeVisitor) check), ImmutableList.of(file), executor, progressReport); | ||
assertThat(context.allAnalysisErrors()).hasSize(1); | ||
|
||
assertThat(logTester.logs()).contains("Unable to analyse file: " + file.absolutePath()); | ||
assertThat(logTester.logs()).contains("Unable to analyse file: " + file.toString()); |
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.
@vilchik-elena if you follow my suggestion on file.uri()
you'll have to update here as well
|
||
@Override | ||
public String relativePath() { | ||
return inputFile.relativePath(); |
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.
SonarQube analysis reported 7 issues Watch the comments in this conversation to review them. 4 extra issuesNote: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:
|
/** | ||
* @deprecated since 4.0, use {@link JavaScriptFile#fileName()} or {@link JavaScriptFile#uri()} | ||
*/ | ||
@Deprecated | ||
String relativePath(); |
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.
@@ -68,7 +68,7 @@ private void checkPlainText() { | |||
if (expectedLines == null) { | |||
expectedLines = headerFormat.split("(?:\r)?\n|\r"); | |||
} | |||
InputFile file = getContext().getJavaScriptFile(); | |||
JavaScriptFile file = getContext().getJavaScriptFile(); |
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.
@vilchik-elena why taking all this pain to wrap InputFile inside JavaScriptFile? The only advantage I would see is to isolate the checks from the plugin-api, but we still have it listed as a dependency in the pom (I presume for good reason) and even then I'm not sure it's worth it. Let me know if I'm missing something
Fixes #837, fixes #839