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

Codeclimate #590

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Codeclimate #590

wants to merge 4 commits into from

Conversation

Blaimi
Copy link
Contributor

@Blaimi Blaimi commented May 6, 2023

PR summary

This PR adds the compatibility to run as CodeClimate Engine.

Closes: #512

Todo

  • write unit tests
  • test in gitlab infrastructure (biletado/apidocs!1) The findings are listed like it is documented for the Premium tier (but they are not shown in the "Changes" like they should because the project has an OSS ultimate license :/) needs a run on the target branch
  • register this or another project for the opensource program at codeclimate and test the integrations on their infrastructure as well as github integration
  • implement include_paths
  • create a docker container with
    • FROM jamescooke/openapi-validator:$version
    • WORKDIR /code
    • ENTRYPOINT ["lint-openapi", "--config", "/config.json", "--codeclimate"]
    • see the more complex Containerfile
  • get in touch with Code Climate and publish as community engine
  • If files cannot be parsed, the validator exits with a non-zero code which crashes the whole execution.

PR Checklist

General checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Dependencies have been updated as needed
  • .secrets.baseline updated as needed?

@CLAassistant
Copy link

CLAassistant commented May 6, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -140,18 +142,18 @@ The validator supports OpenAPI documents in either JSON or YAML format, using th
.yaml
.yml
```
Assuming your command shell supports the use of wildcards, you can use wildcards when specifying the names of files to be validated.
If the string ends with '/', it will be searched recursively for supported files.
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary for the code climate support?

Copy link
Contributor Author

@Blaimi Blaimi May 24, 2023

Choose a reason for hiding this comment

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

Not at all, but a config.json passed by codeclimate file looks like this:

{
  "enabled":true,
  "channel":"stable",
  "include_paths": [
    ".gitignore",
    "public/",
    ".gitattributes",
    "LICENSE",
    ".gitlab-ci.yml",
    "Dockerfile",
    "docker-entrypoint.d/",
    ".codeclimate.yml"
  ],
  "debug":"1"
}

when executing in biletado/apidocs.

One can still add a files section in .codeclimate.yml like I do at the moment for testing until the implementation for the recursive filesearch is implemented. This is then added to the config.json. You can have a look at the .codeclimate.yml I used in the mentioned project for testing this as an engine.

@Blaimi Blaimi force-pushed the codeclimate branch 2 times, most recently from fa9e7b6 to 0333872 Compare May 25, 2023 02:18
@Blaimi Blaimi force-pushed the codeclimate branch 2 times, most recently from 94b4d37 to 0a238fb Compare May 25, 2023 03:23
@Blaimi
Copy link
Contributor Author

Blaimi commented May 25, 2023

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.

[feature request] new output format for Code Climate
3 participants