-
Notifications
You must be signed in to change notification settings - Fork 200
chore: sort icons alphabetically #543
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
Conversation
.stylua.toml
Outdated
@@ -1,4 +1,4 @@ | |||
column_width = 120 | |||
column_width = 130 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately doesn't look like stylua has per file overrides.
7726196
to
13f45e3
Compare
@alex-courtis I am thinking of breaking icon files into separate files holding single table only. Something like:
Splitting to individual files would make it easier to sort programmatically. If we decide to do something like that it best be done in another PR, keeping this one relatively small. Edit: I just saw you did something similar in #418. |
e47e8f8
to
7011a7c
Compare
I like the new alignment , I remember Go and Rust formatters do this kind of aligments automatically, was that done with stylua or script? |
With nvim and mini.align. Shouldn't be too hard to automate it. |
That sounds fantastic... it's very difficult to see which table you are editing. This sounds like the right time, whilst we're touching generation, subsequent PR sounds good. 418 is a proof of concept that needs a lot of work, not sure when I'll get back to it... |
An alternative is emmylua, which is setup for nvim-tree to format via CLI (also CI): https://github.com/nvim-tree/nvim-tree.lua/blob/7a4ff1a516fe92a5ed6b79d7ce31ea4d8f341a72/Makefile#L19 It has align_continuous_similar_call_args which achieves what we're after. stylua was retired in favour of emmylua, mainly to allow easier in-editor formatting via |
And that can make the code confused-contributor proof to prevent distracted maintainers (me) merge PR when key are on wrong table _-_ |
This is fantastic, should have done this long ago:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
.github/workflows/ci.yml
Outdated
@@ -38,7 +38,7 @@ jobs: | |||
with: | |||
token: ${{ secrets.GITHUB_TOKEN }} | |||
version: "0.19" | |||
args: --check lua scripts | |||
args: --respect-ignores --check lua scripts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some tests adding new extensions and it's working as expected.
da9582f
to
b5dd7ac
Compare
|
||
local function iterate_sections() | ||
-- NOTE: technique used (search function and nowrapscan) causes initial search to omit first table | ||
-- Will be simplified in consecutive PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to? Looks good to me...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to future PR which will separate tables into individual files at which point we won't have to iterate over multiple tables in single file any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just fantastic:
- so much code deleted
- generating light completely is super robust - it had so many points of failure
- we've not had to add any fragile new ci/check/script mechanisms, just extended the existing patterns that we know work
We don't even have to update the doc - this handles everything for the dev and will be checked during CI.
What sort of commit message could this be? "icon tables normalised and formatted with one icon per line, light icons completely generated" |
Closes #319
TODO:
generate_colors.lua
generate_colors.lua
What's the consensus for changing format to single line tables like that? This makes sorting alphabetically much easier. We would probably have to find a way to enforce that formatting on CI.