Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

feat(diagnostics): add cmake_lint to go alongside cmake_format #1067

Merged

Conversation

mitchallain
Copy link
Contributor

@mitchallain mitchallain commented Sep 4, 2022

Add support for cmake_lint diagnostics support from the cmakelang Python package, which provides the already supported cmake_format builtin.

cmake_lint does not provide an end_col, so this currently goes to EOL, making underlines a little messy.

"$FILENAME",
},
format = "line",
to_stdin = false,

Choose a reason for hiding this comment

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

So as currently written, the linter will read the file on disk, which means that diagnostics won't update properly until the file is actually written. It does seem that cmake-lint has stdin support, but this PR seems to imply that it doesn't currently work.

Using stdin would be ideal, but other options that we have are writing the buffer's contents to a temp file or only generating diagnostics on save.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, thanks for the feedback. Personal preference would be to switch to DIAGNOSTICS_ON_SAVE. Judging by the age of that PR in cmake_format, stdin may not be fixed soon.

@jose-elias-alvarez
Copy link
Owner

Thanks!

@jose-elias-alvarez jose-elias-alvarez merged commit aba04f5 into jose-elias-alvarez:main Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants