Purge vim/emac local variable bloat
Tackled a long-standing pet-peeve by trimming all files of legacy vim/emac declarations. This is an antiquated manner of handling style data, as all modern tools parse .editorconfig instead. This change is excluded in .git-blame-ignore-revs to prevent any Git noise.
Contributor Checklist:
- [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
- [x] I have updated
CHANGES.txtandRELEASE.txt(and read theREADME.rst). - [x] I have updated the appropriate documentation
Ambitious.
Yeah, obviously that stanza long predates the existence of the editorconfig spec - and shows the reason for it! I'm neutral on whether this is actually "worth doing", I was originally going to dive right in, then backed off. Up to the boss, then :-)
Looks like the (rather fragile) Interactive tests got broken here. This has happened before. These files can't auto-strip trailing blanks because there are expect blocks that have necessary trailing space, like
expect_stdout = """\↵
scons>>> Copy("foo.out", "foo.in")↵
scons>>> Touch("1")↵
scons>>> Copy("foo.out", "foo.in")↵
scons>>> Touch("2")↵
scons>>> scons: `foo-alias' is up to date.↵
scons>>> ↵
"""
Note the trailing space on the last of those.
I imagine we could edit those fairly easily to avoid... say: scons>>> \n"""
Not tested.
Does current vim/emacs read the .editorconfig file?
Does current vim/emacs read the .editorconfig file?
https://editorconfig.org/#pre-installed
tl;dr: yes.
(dunno why they put that section in alphabetical order except emacs which is at the end)
Looks like vim 9 ships the plugin, but 8.0 (default RHEL 8) does not ship the plugin.
I imagine we could edit those fairly easily to avoid... say:
scons>>> \n"""Not tested.
Looks like that would mostly fix the issue, but a few of the files still failed:
Failed the following 3 tests:
test/Interactive/cache-debug.py
test/Interactive/taskmastertrace.py
test/Interactive/version.py
That tweak was already pushing it, but anything beyond that would absolutely be outside the scope of this PR, so I opted to just re-add the extra newlines
Looks like that would mostly fix the issue, but a few of the files still failed:
Yes, I see the second and third of those have an empty scons prompt line (thus ending with space) in a place that isn't the last line of the expect block, so indeed that hack wouldn't finish fixing up those. There are other ways - we'll think about it. As I said, that's happened before - I've had space-stripping for Python enabled for years, before we had an SCons-specific editorconfig.
Okay, this is odd... those files shouldn't have gotten broken due to editing them as the .editorconfig in the project contains:
[test/Interactive/**]
trim_trailing_whitespace = false
Is there some reason that didn't work to protect them? Bad syntax or something?
That's a VSCode issue iirc, where .editorconfig is overridden when it comes to the global trailing whitespace option specifically. It's what I used to do the regex search & replace, and despite disabling ruff/mypy I failed to consider the general formatting options
Looks like vim 9 ships the plugin, but 8.0 (default RHEL 8) does not ship the plugin.
@kprussing you're right. Not yet sure how to process that bit of info... RHEL 8 is past the end of one if its lives, but still gets maintenance support (security fixes) through 2029.
Guess I'm not sure someone pegged to RHEL/Alma/Rocky 8 is going to be actively editing SCons itself...
Guess I'm not sure someone pegged to RHEL/Alma/Rocky 8 is going to be actively editing SCons itself...
Probably true. If they're doing more than just hacking a local copy, I would suspect they would try to migrate the changes back and follow the rules.
Using the .editorconfig also assumes the extensions/plugins are actually enabled by the author.
Using the .editorconfig also assumes the extensions/plugins are actually enabled by the author.
I think we can put some kind of code-style suggestion in the CONTRIbUTING file - like 'enable editorconfig support if available, otherwise these settings".