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

Override analysis_options yaml file with project's #23

Closed
jlin95 opened this issue Jun 19, 2020 · 10 comments
Closed

Override analysis_options yaml file with project's #23

jlin95 opened this issue Jun 19, 2020 · 10 comments

Comments

@jlin95
Copy link

jlin95 commented Jun 19, 2020

Hi, I'm currently trialling the usage of this plugin to be used in my Flutter project.

There are some rules I would like to leave out of the analysis, such as:
dartanalyzer:prefer_double_quotes, as we are practicing using single quotes instead.

Is there a way (like pass in a flag) to indicate to use our own project dir's analysis options file?

Thanks!

@matpag
Copy link

matpag commented Jun 30, 2020

I have the same problem.
It should be possible to disable some checks and use the project analysis-options.yaml file and not the one bundled in the plugin.

@stephanecodes
Copy link
Contributor

I created PR #20 one month ago to add this feature. Meanwhile you can switch to my branch.

@matpag
Copy link

matpag commented Jul 1, 2020

Will try to build your branch as soon as OpenJDK site resurrect (is currently unreachable) to download OpenJDK 11 which is required to build the plugin.

@stephanecodes
Copy link
Contributor

stephanecodes commented Jul 1, 2020

Here is the one I'm using :
sonar-flutter-plugin-0.2-SNAPSHOT-PR20.zip

Follow the documentation update to configure it
https://github.com/stephanecodes/sonar-flutter/tree/feature/allow-existing-analysis-options#use-existing-analysis-options

@matpag
Copy link

matpag commented Jul 1, 2020

Thank you for the help but for security reasons I can't install a JAR which is not coming from a "trusted" source.
I will wait until OpenJDK is back and will test your changes :)

@stephanecodes
Copy link
Contributor

Ok ;)
If by installing you mean on the global SonarQube of your organization, you can try it locally. I'm using SonarQube 7.9.3 LTS
https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.9.3.zip

@sebkoller
Copy link

I was surprised that the plugin overrides existing analysis-options.yaml rules in the first place.

I guess the expected behavior would be to use the existing rules, and if there are none, fallback to some default rules (preferably pedantic or effective dart).

@clairtonluz
Copy link

I need this feature. I using pedantic rules, but when run sonar-scan in my project the analysis-options.yaml is overrided. Do you have any predictions about that?

@stephanecodes
Copy link
Contributor

You can either use the one I provided a month ago or wait for the maintainer to merge my PR.

@zippy1978
Copy link
Contributor

Hi,
I've juste released version 0.3.0 with @stephanecodes PR.
You can use sonar.dart.analysis.useExistingOptions=true in your sonar-project.properties files to use your own analysis-options.yaml
I'm closing the issue.

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

No branches or pull requests

6 participants