Skip to content

Improve algorithm for imports sorting and remove an autoload #33

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

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

Hi-Angel
Copy link
Member

@Hi-Angel Hi-Angel commented Feb 10, 2025

This PR basically does two things: stops considering qualified as part of PureScript syntax, and removes extraneous autoload from the sorting function (the sorting is only useful as part of purescript-mode, which should bring the function into the scope by virtue of requireing the module).

It may be desired to remove qualified from elsewhere as well, but there're a lot of things to improve, so let's do them one small step at a time 😊

Such keyword isn't a thing in Purescript, it has instead syntax
`import Foo as Bar`. I also checked VSCode purescript highlight mode,
it also doesn't have `qualified` in among its sources.
@Hi-Angel
Copy link
Member Author

@purcell hello, new PR, and there are two others in the having been hanging for a while as well.

I'd just kindly remind that I am open to taking a co-maintainership over the project 😊

@Hi-Angel
Copy link
Member Author

Hi-Angel commented Feb 10, 2025

Btw, while at it: I've been thinking to remove from the CI matrix the minor Emacs versions, what do you think? It's just that I don't see the point of testing e.g. 25.1, 25.2, 25.3. They have all the same functional and are only different in fixes. I'd imagine it may be more useful to either only test 25.1 (so we cover the "buggiest" Emacs version) or 25.3 (so we assume the user has updated to the latest minor version).

This improves debuggability of fails, because tests would only show
the part that failed. There's no reason to wrap full code blocks to
`should` because their execution may only exit past `should` if
exception is thrown, which would be caught by `ert` anyway.
The function will be brought into the scope by purescript-mode by
virtue of having a `(require 'purescript-sort-imports)`. No point
additionally declaring it as autoload.
@purcell
Copy link
Member

purcell commented Feb 11, 2025

This PR basically does two things: stops considering qualified as part of PureScript syntax

What's the change visible to users here?

@Hi-Angel
Copy link
Member Author

This PR basically does two things: stops considering qualified as part of PureScript syntax

What's the change visible to users here?

None. It just removes clutter from the old code. The project was based on haskell-mode sources and has haskell-specific leftovers all over the place.

@purcell purcell merged commit ae7b21c into purescript-emacs:master Feb 11, 2025
10 checks passed
@purcell
Copy link
Member

purcell commented Feb 11, 2025

Got it, makes sense, I'd forgotten that there's no "qualified" in Purescript 👍

@Hi-Angel
Copy link
Member Author

Thank you! What do you think about this, btw, would you accept such PR?

@Hi-Angel
Copy link
Member Author

Got it, makes sense, I'd forgotten that there's no "qualified" in Purescript 👍

Btw, I don't want to look like a bad contributor, so I'd just point out these details are mentioned in the commit description 😅 I put to the PR description just a short summary of the changes done by the commits

@purcell
Copy link
Member

purcell commented Feb 11, 2025

Thanks for writing good commit messages, this is widely neglected. 💪 My 2c of advice: if you're going to write a PR description (yay!), that's the main communication to the maintainer, and inspecting each commit should be optional: the primary thing to capture when making a contribution is "why?", because it translates to "why should the maintainer care about merging this?". Here the PR title strongly implied you'd changed the sorting algorithm, which sounded like a functionality change, hence my question.

@purcell
Copy link
Member

purcell commented Feb 11, 2025

BTW, sent you an invite to join this org. I'd still recommend you open pull requests for review & visibility rather than pushing changes directly, but this should at least streamline the contribution process for you. Thanks for helping out!

@Hi-Angel
Copy link
Member Author

BTW, sent you an invite to join this org.

Thank you!

I'd still recommend you open pull requests for review & visibility rather than pushing changes directly, but this should at least streamline the contribution process for you. Thanks for helping out!

Thank you, sure! I will be leaving pull requests open for some days for review and more testing by me, and then if nobody comments on them would merge.

Hi-Angel added a commit to Hi-Angel/purescript-mode that referenced this pull request Feb 18, 2025
No point in testing minor Emacs releases, because they have no major
features anyway, fixes only. E.g. given Emacs 25: 25.1, 25.2 and 25.3
are only different in amount of fixes. It isn't expected that
something may break between these releases.

So there's not much point in running tests on all of them. This commit
removes most minor Emacs versions and only leaves in the initial
release for each Emacs major version.

It was brought up here before
purescript-emacs#33 (comment)
so far to no opposition.
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

Successfully merging this pull request may close these issues.

2 participants