Skip to content

SONARPY-353 Use semantic engine from PyCharm and migrate S4823 (CommandLineArgsCheck) hotspot rule#259

Closed
mpaladin wants to merge 6 commits intomasterfrom
SONARPY-353
Closed

SONARPY-353 Use semantic engine from PyCharm and migrate S4823 (CommandLineArgsCheck) hotspot rule#259
mpaladin wants to merge 6 commits intomasterfrom
SONARPY-353

Conversation

@mpaladin
Copy link
Copy Markdown
Contributor

No description provided.

@mpaladin mpaladin force-pushed the SONARPY-353 branch 3 times, most recently from e95c48c to fd360e6 Compare July 26, 2019 15:15
@andrea-guarino-sonarsource andrea-guarino-sonarsource marked this pull request as ready for review August 12, 2019 09:05
@andrea-guarino-sonarsource andrea-guarino-sonarsource changed the title SONARPY-353 SONARPY-353 Use semantic engine from PyCharm and migrate S4823 (CommandLineArgsCheck) hotspot rule Aug 12, 2019

protected abstract String message();

protected boolean isException(PsiElement node) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about having a more useful type for node?
In fact, this method is useless so far since it's never overridden.

@NotNull
private static PyFile parseAs(String content, LanguageLevel languageLevel) {
PsiFile file = psiFileFactory.createFileFromText("test.py", PythonFileType.INSTANCE, normalizeEol(content), System.currentTimeMillis(), false, false);
PsiFile file = psiFileFactory.createFileFromText("test.py", PythonFileType.INSTANCE, normalizeEol(content), System.currentTimeMillis(), true, false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that change?

PsiBuilderFactoryImpl psiBuilderFactory = new PsiBuilderFactoryImpl();
application.registerService(PsiBuilderFactory.class, psiBuilderFactory);
application.registerService(ProgressManager.class, ProgressManagerImpl.class);
application.registerService(PropertiesComponent.class, PropertiesComponentImpl.class);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All unit tests are green if I remove this line.

registerExtension(PythonDialectsTokenSetContributor.EP_NAME, new PythonTokenSetContributor());

registerExtensionPoint(ConfigurationType.CONFIGURATION_TYPE_EP, ConfigurationType.class);
registerExtension(ConfigurationType.CONFIGURATION_TYPE_EP, new PythonTestConfigurationType());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All unit tests are green if I remove the 2 lines above.

registerFileTypeFactory();

registerExtensionPoint(PyReferenceCustomTargetChecker.Companion.getEP_NAME(), PyReferenceCustomTargetChecker.class);
registerExtension(PyReferenceCustomTargetChecker.Companion.getEP_NAME(), new PyTestFixtureTargetChecker());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All unit tests are green if I remove the 2 lines above.


ExtensionPointName<QueryExecutor> superMethodSearch = ExtensionPointName.create("Pythonid.pySuperMethodsSearch");
registerExtensionPoint(superMethodSearch, QueryExecutor.class);
registerExtension(superMethodSearch, new PySuperMethodsSearchExecutor());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All unit tests are green if I remove the 3 lines above.

return sdkDir;
}

private static void copyResource(String res, String dest) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having dest as a java.io.File would be clearer to me.

</includes>
</filter>
<filter>
<artifact>com.jetbrains.pycharm:jps-model</artifact>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update whitelist on jps model

@andrea-guarino-sonarsource andrea-guarino-sonarsource deleted the SONARPY-353 branch September 13, 2019 15:13
hashicorp-vault-sonar-prod Bot pushed a commit that referenced this pull request May 22, 2025
…259)

GitOrigin-RevId: 745efcfcfbe6cc9c83275302d7a97b1633b81293
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants