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

Create basic linter for .db files #48

Open
vnadot opened this issue Apr 15, 2021 · 4 comments
Open

Create basic linter for .db files #48

vnadot opened this issue Apr 15, 2021 · 4 comments

Comments

@vnadot
Copy link
Collaborator

vnadot commented Apr 15, 2021

The idea would be to create basic linter for .db files to see if it required a lot of work. For starter, the extension could detect the following error: DESC field > 41 in EPICS 3.15.

Some links:

@gfrn
Copy link

gfrn commented Oct 18, 2021

EPICS seems to already have a basic lexical analyzer structure going on (with yacc/lex) that is able to at provide (at least partially) a great starting point:

That being said, it'll require some additional work to mold the already existing tools to the desired state, but I'll try to look into it this week/weekend and come up with a basic viable linter based on that.

If anyone has any tips, ideas or ongoing work, I'd be glad to hear more!

@gfrn
Copy link

gfrn commented Oct 22, 2021

I was able to create a little something since yesterday, which I hope is in line with the overall vision for the linter:

https://github.com/cnpem-iot/epics-linter

Currently, it only supports .db files, but I believe the output pattern is fairly easy to parse, following this pattern:
{error} at {line}:{column} or {error} at {line}:{column} to {line:column}. Here is an example:

record(ai, "test") {
    field(DESC, "a way too long description name that does not fit in the maximum limit")
    field(DTYP, "stream")
    field(EGU, "$(EGU)")
    [...]
}

Record description too long (maximum of 40) at 2:17 to 2:89

As for the amount of work required, it is all fairly simple and modular. Thanks to Lark, the grammar syntax was easily ported from the yacc/lex solution and it provides a fairly robust mechanism for detecting and describing syntax errors.

If there's another route that seems better, please let me know!

@gfrn
Copy link

gfrn commented Feb 16, 2022

@vnadot Hello! I've received a notification for this project and I wanted to make sure that interest for a linter still existed. Github tends to not notify people in issues they're in sometimes, so I just wanted to check.

@vnadot
Copy link
Collaborator Author

vnadot commented Feb 16, 2022

Hi @gfrn , yes it still exists ! However since several months I have no time to assign to vscode-epics. I hope to find some times in several monts but it is a bit crazy at work right now. Cheers, Victor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants