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

nimsuggest: clean up nimsuggest.nim.cfg #901

Merged

Conversation

bung87
Copy link
Contributor

@bung87 bung87 commented Sep 15, 2023

Summary

Remove obsolete and disabled configuration options from the
nimsuggest.nim.cfg configuration file.

Details

  • remove adding lib/packages/docutils to the import paths; imports
    in the compiler and tools should not (and do not) rely on extra
    import paths besides the compiler root and library directory
  • remove the outdated and disabled defines for the booting and
    noDocgen symbols

The useStdoutAsStdmsg define, while also obsolete, is kept for
consistency with the compiler and nimfix, both which also define
this conditional symbol.

@zerbina
Copy link
Collaborator

zerbina commented Sep 15, 2023

The change looks good to me, but if you also remove the two disabled define lines, the title of the PR could be changed to clean up nimsuggest.nim.cfg.

@zerbina zerbina added refactor Implementation refactor tool Improvements to non-compiler tooling labels Sep 15, 2023
@zerbina zerbina added this to the Tooling milestone Sep 15, 2023
@bung87 bung87 changed the title remove path option docutils from nimsuggest config clean up nimsuggest.nim.cfg Sep 15, 2023
@bung87 bung87 changed the title clean up nimsuggest.nim.cfg tool: nimsuggest clean up nimsuggest.nim.cfg Sep 15, 2023
@zerbina
Copy link
Collaborator

zerbina commented Sep 15, 2023

Since you've also removed the active useStdoutAsStdmsg define, please mention in the PR message what it does.

@bung87
Copy link
Contributor Author

bung87 commented Sep 15, 2023

updated.

@zerbina
Copy link
Collaborator

zerbina commented Sep 15, 2023

I'm a bit uneasy about the useStdoutAsStdmsg change. While, as you noted, none of the compiler/nimsuggest code currently uses stdmsg, it could again in the future, and then the behaviour of code shared between the compiler and nimsuggest would be different depending on what program the code is compiled for (the useStdoutAsStdmsg condition symbol is enabled for both the compiler and nimfix).

I think it'd be better to leave the conditional symbol be.

@bung87
Copy link
Contributor Author

bung87 commented Sep 15, 2023

no, they should use config's writeHook and writeLnHook

@zerbina
Copy link
Collaborator

zerbina commented Sep 15, 2023

Yep, I agree. But for consistency with the other programs (compiler and nimfix), I think that the define should either be used by all of them or none of them.

If none should, then I think that's better changed as a separate PR.

@bung87 bung87 force-pushed the remove-docutils-from-nimsuggest-config branch from 52cacfc to 5a90343 Compare September 16, 2023 05:20
@bung87
Copy link
Contributor Author

bung87 commented Sep 16, 2023

updated.

@zerbina zerbina changed the title tool: nimsuggest clean up nimsuggest.nim.cfg nimsuggest: clean up nimsuggest.nim.cfg Sep 16, 2023
@zerbina
Copy link
Collaborator

zerbina commented Sep 16, 2023

@bung87: I've updated the PR title and body.

The removal of the disabled defines is self-explanatory, but removing the additional import path is not. In general, something being unused doesn't necessarily warrant its removal, so I added some elaboration as to why the import path should be removed.

@bung87
Copy link
Contributor Author

bung87 commented Sep 16, 2023

okay, thank you! this one make me re consider the description thing, as it's 3 lines removal from config file, I never thought it worth to write such long description, as they exists maybe just by arbitrarily copy paste. anyway I'll try to do better.

@zerbina
Copy link
Collaborator

zerbina commented Sep 16, 2023

Personally, I think the length of the PR message should be dependent on the impact and complexity of the change, not on the number of lines changed. Nonetheless, I also think that a description should not be lengthy just for the sake of being long.

Take, for example, a hypothetical PR that removes all superfluous whitespace in a repository. If many of those exists, the changeset of said PR would be very large, possibly modifying each and every file. The impact on the code, architecture, future consideration, etc. would be very small, however, and I think a short description that includes a reason why superflous whitespace should be removed is enough.

On the other hand, even a single-line change can have a profound impact on the code base and possibly invalidate many invariants, in which case a longer description detailing the reasoning, consequences, etc. is warranted/needed.

@zerbina
Copy link
Collaborator

zerbina commented Sep 16, 2023

/merge

@github-actions
Copy link

Merge requested by: @zerbina

Contents after the first section break of the PR description has been removed and preserved below:


@chore-runner chore-runner bot added this pull request to the merge queue Sep 16, 2023
Merged via the queue into nim-works:devel with commit 0a90e7c Sep 16, 2023
18 checks passed
@bung87 bung87 deleted the remove-docutils-from-nimsuggest-config branch September 16, 2023 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Implementation refactor tool Improvements to non-compiler tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants