camaraproject / QualityOnDemand

Repository to describe, develop, document and test the QualityOnDemand API family
https://wiki.camaraproject.org/x/zwOeAQ
Apache License 2.0
37 stars 60 forks source link

Enable java linting in megalinter with linting rules #215

Closed ravindrapalaskar17 closed 9 months ago

ravindrapalaskar17 commented 10 months ago

As part of this PR: - https://github.com/camaraproject/QualityOnDemand/pull/207 megalinter added in QOD repository. But JAVA linting is disabled in above PR also linting rules is not defined.

This PR is for enable the JAVA linting in QOD repository:

  1. Enabled the JAVA linting and megalinter.yaml
  2. Set JAVA linting rule in javalinting.xml
eric-murray commented 10 months ago

Hi @ravindrapalaskar17

Can you run these linting rules on the current QoD release (0.9.0) to show what changes it would request?

A recent update to the API Design Guidelines recognised that inappropriate use of keywords in an API OAS definitions could cause problems with code generators, so I'm open to this being enforced by linting rules.

But we need to be careful not to be overly restrictive in how we construct our OAS definitions simply to avoid problems that are fundamentally those of the code generators themselves and not of OAS.

hdamker commented 9 months ago

@eric-murray:

Can you run these linting rules on the current QoD release (0.9.0) to show what changes it would request?

As discussed within the call: linting of YAML files is already active since #207. In #207 you can also find the (minor) changes within qod-api.yaml to adapt to linting. Currently we have not many CAMARA specific rules defined ... there is https://github.com/camaraproject/Commonalities/issues/15 to develop them in line with the CAMARA Design Guidelines.

The current PR here will only add the linting of JAVA files (with a custom ruleset which fits to the used codestyle ... might need to revised if there will a project wide JAVA codestyle in future).