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

contrib/check-whitespace: Use / for all platform #52468

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

inkydragon
Copy link
Sponsor Member

When built on Windows, the source code build will not pass check-whitespace.

check-whitespace issues (truncated):

$ make check-whitespace
Whitespace check found 1658 issues:
src/flisp/aliases.scm:25 -- tab
src/flisp/aliases.scm:27 -- tab
src/flisp/aliases.scm:28 -- tab
src/flisp/aliases.scm:29 -- tab
src/flisp/aliases.scm:73 -- tab
src/flisp/color.lsp:55 -- tab
....

Because git ls-files use / as a path separator on Windows.

for path in eachline(`git ls-files -- $patterns`)

"git ls-files" output on win (truncated):

$ git ls-files -- *.jl
base/Base.jl
base/Enums.jl
base/abstractarray.jl
base/abstractarraymath.jl
base/abstractdict.jl
base/abstractset.jl
base/accumulate.jl
...

But joinpath gives \\ on win, so it won't match.

allow_tabs(path) =
path == "Make.inc" ||
endswith(path, "Makefile") ||
endswith(path, ".make") ||
endswith(path, ".mk") ||
startswith(path, joinpath("src", "support")) ||
startswith(path, joinpath("src", "flisp")) ||
endswith(path, joinpath("test", "syntax.jl")) ||
endswith(path, joinpath("test", "triplequote.jl"))

Change: just use / for all platforms.

@inkydragon inkydragon added domain:building Build system, or building Julia or its dependencies system:windows Affects only Windows labels Dec 9, 2023
@vtjnash vtjnash merged commit 0a6ae7c into JuliaLang:master Dec 12, 2023
7 of 9 checks passed
@inkydragon inkydragon deleted the win-check-whitespace branch December 12, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:building Build system, or building Julia or its dependencies system:windows Affects only Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants