-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
replace non-breaking spaces with plain spaces #44228
Conversation
Some of my most important work. |
These kinds of changes can be a bit disruptive as far as git blame, etc. goes. There may be a way to mitigate it: https://tekin.co.uk/2020/09/ignore-linting-and-formatting-commits-when-running-git-blame |
This is mostly adding trailing newlines which don't affect git blame. |
1e207c2
to
f9f097d
Compare
Well this snowballed. We now check for all trailing whitespace, and that line endings are UNIX style ( |
I think it would be worth adding a git blame ignore file for this afterward. |
It doesn't actually touch a lot of meaningful lines, but sure. There's one file that had Windows line endings, a bunch of files with too many or too few trailing newlines, and a bunch of places where there were non-breaking spaces (but many were due to me anyway). Blame for most of that stuff doesn't matter. |
Having those refer to the original commit where they were added seems like it makes sense. What's the harm in adding the file? |
No problem if you want to do it. |
f9f097d
to
0d072a4
Compare
@staticfloat, I assume that the whitespace check that's failing is running the version of
Option two seems better and more reliable. This check would be easy to implement in Julia, but we don't have Julia at that point, so presumably the check would have to be implemented in some other language like Python or Perl. What language do we already depend on that I can do this in? |
Yes, that's correct. You can see precisely which gitsha (
The test job is running inside of a rootfs, which is installing the default
So we could try a different built of
Perhaps somewhat surprisingly, we can have Julia here; with one small tweak, we can have the Julia that we used to setup the sandbox (v1.6) available inside of the sandbox. Here's the tweak, and here's the proof |
@staticfloat, what do you prefer? Should I reimplement the whitespace check as a Julia program or is it easier to upgrade |
It's up to you, but I'm not confident that a newer version of In addition to whatever version of Julia you desire, you have access to the following tools (or newer, if we upgrade the rootfs image):
|
Ok, wrote the whitespace check script in Julia. |
Btw, please DON'T squash merge this—having the changes separate makes it much easier to resolve any merge conflicts that may come up since each commit does a specific thing that can be automated. |
This is good as far as I'm concerned. If it passes CI it can be merged (non-squash). |
.buildkite/pipelines/main/misc/signed_pipeline_test.yml.signature
Outdated
Show resolved
Hide resolved
It would be ideal to get all CI passes green but it seems pretty unlikely that this change is related to the various failures here. Up to those managing these CI failures to decide what to do here (wait for green or merge [NO SQUASH PLEASE] before). |
Maybe try rebase it on lastest master to get a fresh CI run (CI doesn't run on merge commit). |
21c534d
to
8154f95
Compare
We'll need to install Julia inside the whitespace job: JuliaCI/julia-buildkite#58 |
Can you CI guys fix this up with additional commits to make it work? I can rebase the history once it's working but I don't think I can get this working myself with the CI stuff in flux. |
Definitely. Is it cool if I push directly to this branch? And then you can rebase when it's all green. |
Yeah, go for it. Just add commits and I'll fix it up later. |
This now checks for: - trailing non-ASCII whitespace - non-breaking spaces anywhere - non-UNIX line endings - trailing blank lines - no trailing newline Git can't handle this, largely because whether it interprets files as UTF-8 or Latin-1 depends on how system libraries that it uses for regex matching are compiled, which is inconsistent and hard to fix. The end of file checks are also quite awkard and inefficient to implement with Git and shell scripting. Julia is fast and lets us present results clearly.
3cf3f70
to
b07b5ba
Compare
@StefanKarpinski Looks like Buildkite is green on this now. |
Does that mean it's safe to merge this PR? Buildbot failures look unrelated. |
Yes, I think you can merge this PR. |
Also end all text files with newlines.