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

New linter for toml files: smol #2732

Open
josecelano opened this issue Jun 9, 2023 · 18 comments
Open

New linter for toml files: smol #2732

josecelano opened this issue Jun 9, 2023 · 18 comments
Labels
enhancement New feature or request O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity

Comments

@josecelano
Copy link

Is your feature request related to a problem? Please describe.

It's not a problem. I just would like to add a new linter for toml files.

Describe the solution you'd like

I would like to add a new linter:

taplo fmt --check Cargo.toml

Describe alternatives you've considered

I do not know any other toml file formatter.

Additional context

I think Toml files are very common in Rust. I want to format toml files in this project: torrust/torrust-index#116. I was considering adding taplo directly in a workflow but I would prefer to use MegaLinter because I can easily add more linter in the future.

@josecelano josecelano added the enhancement New feature or request label Jun 9, 2023
@nvuillam
Copy link
Member

hi @josecelano :)

taplo linter seems maintained, there is clearly a need to lint TOML files, so it seems to be a good candidate ! :)

https://github.com/tamasfe/taplo

My only question, on their README it says :

The project is very young, so bugs and incomplete features are expected, so any help is welcome!

The correctness of the TOML parsing and decoding is not yet entirely guaranteed (as there is no official 1.0.0 compliance test suite yet).

As a taplo user, do you confirm that it is stable and evolved enough to be embedded in default MegaLinter, or maybe it is safer to just implement it as a MegaLinter plugin before it is stabilized ?

@josecelano
Copy link
Author

hi @josecelano :)

taplo linter seems maintained, there is clearly a need to lint TOML files, so it seems to be a good candidate ! :)

https://github.com/tamasfe/taplo

My only question, on their README it says :

The project is very young, so bugs and incomplete features are expected, so any help is welcome!

The correctness of the TOML parsing and decoding is not yet entirely guaranteed (as there is no official 1.0.0 compliance test suite yet).

As a taplo user, do you confirm that it is stable and evolved enough to be embedded in default MegaLinter, or maybe it is safer to just implement it as a MegaLinter plugin before it is stabilized ?

Hi @nvuillam I'm not using it yet. I want to start using a toml formatted.

I did not know about plugins. I think a plugin would be ok. In fact, I do not know if there are other toml formatters that could be more mature or stable. I do not see many:

toml-lang/toml#532

@nvuillam
Copy link
Member

@josecelano I propose you to start with a plugin, then if we see it's great we move it as natively embedded linter ? :)

@github-actions
Copy link
Contributor

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

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jul 12, 2023
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jul 12, 2023
@github-actions
Copy link
Contributor

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

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 12, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2023
@vonbraunbates
Copy link

What's happened to supporting a(ny) TOML linter in Megalinter? According to the Megalinter docs, we have some linters which only accept TOML config files (e.g Black, Ruff, Gitleaks...) so it would be somewhat counter-intuitive to be unable to lint our own linter settings.

@bdovaz bdovaz reopened this Jun 19, 2024
@echoix
Copy link
Collaborator

echoix commented Jun 19, 2024

I or any of the maintainers here would be glad to review a PR for this. Is the status of taplo a bit better now?

@bdovaz bdovaz removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jun 19, 2024
@vonbraunbates
Copy link

Not a TOML expert (I'd never heard of it until I had to configure some linters), but I've done a quick round-up of parsers which support the TOML 1.0.0 standard and are recently maintained:

I suppose you should pick whichever integrates best with Megalinter, assuming any have reached a suitable stage of maturity. 🤷‍♀️ The ones I've ruled out are:

@nvuillam
Copy link
Member

@vonbraunbates many thanks for your benchmark :)

I'll write an issue on taplo repo to ask them if they can remove their warning message, as they now have 1.2K stars now :D

@echoix
Copy link
Collaborator

echoix commented Jun 24, 2024

Taplo sadly doesn't seem like the best choice following this: tamasfe/taplo#626 (comment)

@vonbraunbates
Copy link

Copy link
Contributor

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

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 10, 2024
@vonbraunbates
Copy link

☝️ any updates on this please? Currently Megalinter can't lint its own config files sine some linters only accept TOML config.

@nvuillam
Copy link
Member

We could try smol :)

@github-actions github-actions bot removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 13, 2024
Copy link
Contributor

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

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 12, 2024
@vonbraunbates
Copy link

Should we change the title to New linter for toml files: smol then?

@josecelano josecelano changed the title New linter for toml files: taplo New linter for toml files: smol Sep 12, 2024
@nvuillam
Copy link
Member

nvuillam commented Sep 12, 2024

I don't see CLI instructions in smol-toml documentation...

I posted an issue to see if there is one, or if they are ok to build one :)

squirrelchat/smol-toml#27

@github-actions github-actions bot removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 13, 2024
Copy link
Contributor

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

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity
Projects
None yet
Development

No branches or pull requests

5 participants