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

[BUG] Spectral linting not working #567

Closed
fabienmazieres opened this issue Jun 11, 2024 · 3 comments · Fixed by #568
Closed

[BUG] Spectral linting not working #567

fabienmazieres opened this issue Jun 11, 2024 · 3 comments · Fixed by #568

Comments

@fabienmazieres
Copy link
Contributor

Release version

APIOps Toolkit for Azure APIM v5.1.4

Describe the bug

I believe the following line in the GitHub workflow does not work as expected, Spectral does not find any file to lint as it search for JSON/YAML files at the root of the apis folder rather than in any subfolder:
- run: spectral lint "${{ GITHUB.WORKSPACE }}/${{ inputs.API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH }}\apis\*.{json,yml,yaml}" --ruleset https://raw.githubusercontent.com/connectedcircuits/devops-api-linter/main/rules.yaml

To execute tests on all subfolders, the code should include \**\ in the file path, such as:
- run: spectral lint "${{ GITHUB.WORKSPACE }}/${{ inputs.API_MANAGEMENT_SERVICE_OUTPUT_FOLDER_PATH }}\apis\**\*.{json,yml,yaml}" --ruleset https://raw.githubusercontent.com/connectedcircuits/devops-api-linter/main/rules.yaml

Expected behavior

Spectral lint all files with the apis subfolders

Actual behavior

no linting is occuring

Reproduction Steps

create an invalid spec file in the apis folder and see if Spectral find the error.

Copy link

  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.

@fabienmazieres
Copy link
Contributor Author

This should be fixed by #568 , thanks!

@martin2176
Copy link

@fabienmazieres
the issue reappeared in 6.0.1.3 as well as another syntax error of using backslash instead of forward slash
#701

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 a pull request may close this issue.

2 participants