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

Fix request for spectral linter #270

Closed
ahokkonen opened this issue Dec 7, 2021 · 10 comments · Fixed by #271 or #294
Closed

Fix request for spectral linter #270

ahokkonen opened this issue Dec 7, 2021 · 10 comments · Fixed by #271 or #294
Assignees
Labels
problem The specification equivalent of a bug to be addressed.

Comments

@ahokkonen
Copy link
Contributor

New version of spectral linter requires ruleset parameter.
Creating default ruleset as part of the sources to solve that issue.

@ahokkonen ahokkonen added the problem The specification equivalent of a bug to be addressed. label Dec 7, 2021
@ahokkonen ahokkonen linked a pull request Dec 7, 2021 that will close this issue
@cookeac
Copy link
Collaborator

cookeac commented Dec 8, 2021

@ahokkonen it doesn't look like that PR quite worked. The message is now:
Cannot find module '/usr/src/spectral/{{env.SPECTRAL_RULESET_PATH}}'

@ahokkonen
Copy link
Contributor Author

@cookeac legendary- working on my machine :)
I will look into it

@stale
Copy link

stale bot commented Mar 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-issue Identifies that an issue is stale and will be closed unless reactivated. label Mar 16, 2022
@cookeac cookeac removed the stale-issue Identifies that an issue is stale and will be closed unless reactivated. label Mar 17, 2022
@cookeac cookeac linked a pull request Apr 22, 2022 that will close this issue
cookeac added a commit that referenced this issue May 5, 2022
Attempt to fix Spectral paths. Resolves #270
cookeac added a commit that referenced this issue May 5, 2022
cookeac added a commit that referenced this issue May 5, 2022
Another attempt to fix the spectral ruleset problem. Resolves #270
@stale
Copy link

stale bot commented Jun 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-issue Identifies that an issue is stale and will be closed unless reactivated. label Jun 16, 2022
@cookeac cookeac removed the stale-issue Identifies that an issue is stale and will be closed unless reactivated. label Jul 7, 2022
@alamers alamers self-assigned this Jul 28, 2022
@alamers
Copy link
Collaborator

alamers commented Jul 28, 2022

I've encountered this one as well (and it still seems to be an issue).

In my branch, I've fixed the paths but I get this very descriptive error message:

Arjans-MacBook-Pro:ICAR arjanl$ docker run stoplight/spectral:6.4.1 lint  https://raw.githubusercontent.com/alamers/ICAR/issue293/url-schemes/exampleUrlScheme.json -r=https://raw.githubusercontent.com/alamers/ICAR/issue293/.spectral.yaml  --verbose
Error running Spectral!
Error #1: [object Object]
Error #2: [object Object]
Error #3: [object Object]
Error #4: [object Object]
Error #5: [object Object]

No clue how to continue along this path. Now testing with a default spectral github action (instead of relying on that docker image).

@alamers
Copy link
Collaborator

alamers commented Jul 28, 2022

Yep, the action does work (but now fails with proper validation errors). I'll create a pull request.

@alamers
Copy link
Collaborator

alamers commented Jul 28, 2022

Well... it does a bit more but I have no clue where it leaves its output. Maybe we should simply remove it and rely on speccy only?

@alamers
Copy link
Collaborator

alamers commented Jul 28, 2022

The speccy validations fails also by the way, but that doesn't stop the build (and still gives a green light..)

@cookeac
Copy link
Collaborator

cookeac commented Aug 25, 2022

At our meeting 2022-08-25 we agreed:

  • Spectral is a better linter and works well in individual development environments
  • However Spectral is really not working in GitHub, regardless of whether with the official GitHub action or using an image.
  • @alamers will attempt to remove or deactivate these actions.

@cookeac
Copy link
Collaborator

cookeac commented Oct 6, 2022

I found that spectral gives an incorrect error about an invalid array item type.
However, the error is actually caused by an error in the array item included by $ref, or by another object within that included by $ref. This can be a bit tricky to find, but when the error is corrected, the spectral error goes away.
I think that because validation further down fails, the type included by $ref is no longer an object, hence the invalid array type.

I have installed the spectral validator component into VS Code and used it to clean up files before doing a PR/merge.

@cookeac cookeac closed this as completed Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem The specification equivalent of a bug to be addressed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants