-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add "Autofix" feature for common linting errors (w/ spectral) #160
Comments
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
TO REMOVE STALE LABEL |
@ivangsa As per my understanding of this issue. I conclude that Our goal is: to provide auto-fix refactoring for the most common and standard spectral linting errors for Asyncapi. As mentioned above, AsyncAPI-Preview + Spectral for VSCode is sufficient to achieve the functionality. Spectral: It's an API style guide linter and enforcer. We can use Spectral rules to target API descriptions for quality improvement and enforce API style guides. asyncapi-preview: It helps us to preview AsyncAPI documents inside VSCode. Currently, I am exploring the Phase One of implementation. Looking forward to working on this issue. Thanks |
Hi @ivangsa,
For Phase Two:
Additionally, Adding Test Scripts to mock and test the autoFix Functions. For diagnosis, the spectral for VSCODE Extension can be used. If you have some vacancy here, then I would like to further investigate and contribute to this Issue with the coming GSOC Implementation Phase along with the Markdown+Mermaid Preview Feature. For which may need your support to build the implementation plan. |
Hii @ivangsa Hello! I'm Aditya Singh, a Computer Science undergraduate from India with a passion for open-source contributions. Previously, I had the opportunity to participate in Google Summer of Code at Rocket.chat, which was an enriching experience. This season, I'm eager to channel my skills and knowledge into contributing to AsyncAPI. This project has captured my interest and I would love to build this VS code extension, and I'm excited about the potential impact I can make by contributing to AsyncAPI. I'm looking forward to contributing and making some impact... |
Hi, @ivangsa. I think this idea is interesting and would like to work on this one. Without further ado, I tried to write some codes for practice. Based on my understanding, we need to get those linting errors before applying any autofix. Below are two ways I figured could be possible solutions for retrieving error messages from spectral in phase 1:
Personally I prefer the second way as we already have a spectral extension out there so don't need to bother ourselves to integrate its functions into our own (also I could be wrong). Another reason I thought the second way is practical is because vscode provides API such as If anyone has any comments on this, welcome to discuss together! P.S. Do we have any issue tagged "first issues" for this project? |
I'm particularly drawn to the "AsyncAPI: Add 'Autofix' feature for common linting errors (w/ spectral)" project for several reasons. Firstly, the opportunity to work on an open-source project like AsyncAPI excites me, especially because it's at the intersection of API design and tooling, which are areas I'm passionate about. Additionally, the prospect of developing a VS Code extension to enhance the linting experience using Spectral is intriguing.
With prior experience in GSOC with Rocket.chat I value open lines of communication with mentors and project coordinators to discuss goals, expectations, and any challenges that may arise throughout the project. Additionally, I thrive in an environment that encourages creativity and problem-solving, where I can explore different approaches and technologies to achieve project objectives
While working on this project, I anticipate delving deeper into Spectral and understanding its capabilities for linting AsyncAPI documents. Additionally, I'll be exploring the intricacies of developing VS Code extensions and integrating them seamlessly into developers' workflows.
In terms of organization, I rely heavily on project management tools like Notion to keep track of tasks, deadlines, and progress. I find that breaking down larger tasks into smaller, manageable chunks helps maintain focus and momentum. For development, I prefer using modern tools and frameworks that streamline the development process and enhance collaboration. I'm comfortable working with Git for version control and GitHub for managing repositories and collaborating with teammates. Visual Studio Code is my go-to editor for its versatility and extensive ecosystem of extensions.
Throughout the project, I'll maintain regular communication with mentors and provide updates on progress, challenges, and any adjustments to the schedule as necessary. |
For phase 2: how to implement autofix feature,
Other things to note: when applying the fixing, sort the problems as their text range to avoid conflicts. |
AsyncAPI-Preview + Spectral for VSCode form a perfect combo interms of UX/DX for asyncapi editing:
VSCode comes with an API for providing quick/autofixes for linting errors (see https://code.visualstudio.com/docs/editor/refactoring https://code.visualstudio.com/api/references/vscode-api#CodeActionProvider and https://github.com/microsoft/vscode-extension-samples/tree/main/code-actions-sample for an example)
The pourpose of this feature is to provide autofix refactoring for most common and standard spectral linting errors for asyncapi:
https://docs.stoplight.io/docs/spectral/1e63ffd0220f3-async-api-rules
Implementation
Phase One:
https://github.com/stoplightio/yaml and https://github.com/stoplightio/json
Phase Two:
autofix rules
from external filesThe text was updated successfully, but these errors were encountered: