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

feature: track line-column of value definition #6

Open
FelipeLema opened this issue May 3, 2024 · 5 comments
Open

feature: track line-column of value definition #6

FelipeLema opened this issue May 3, 2024 · 5 comments

Comments

@FelipeLema
Copy link

this way we can write linters using this package, pointing to the source of the problems

@FelipeLema
Copy link
Author

I can do a PR if maintainers are willing to accept this feature

@o3o
Copy link
Collaborator

o3o commented May 22, 2024

Hi @felipe,

Thank you for your offer! We appreciate contributions from the community. Could you please provide more details about the feature you have in mind?

@FelipeLema
Copy link
Author

FelipeLema commented May 22, 2024

let's say I have a TOML file that has an array defined:

[nonImportant]
a = 1

[someArray]
something_A
something_B
something_Z

[otherNonImportant]
b = 2

and I have a fellow committer adding something to this array, like so

[nonImportant]
a = 1

[someArray]
something_A
something_B
something_Z
something_C # ← added this to the array

[otherNonImportant]
b = 2

I would like to write a linter that reads the TOML file, checks the array and points out that the array is not lexicographically ordered

# …

[someArray] # ← "hey, something happened and this array is not ordered"
something_A
something_B
something_Z # ← "I was expecting something_C here"
something_C

# …

@FelipeLema
Copy link
Author

FelipeLema commented May 22, 2024

to have the above, I'd a appreciate something like EnumeratedTOMLDocument that holds EnumeratedTOMLValude, in which each value holds the line where they were defined

an end user like me could use that, but the default would stay the same.

The compiler would recognize the use of line tracking code and optimize those code blocks out with default settings. If it doesn't look like the compiler will optimize those "line tracking" code blocks, I guess a thorough re-write would be necessary to comply

@o3o
Copy link
Collaborator

o3o commented May 27, 2024

thank you for your response. these days I am very busy, as soon as I have time I will better analyze the effects of your request

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

No branches or pull requests

2 participants