Skip to content

build.d: Add checkwhitespace#10499

Closed
MoonlightSentinel wants to merge 2 commits intodlang:masterfrom
MoonlightSentinel:check-whitespace
Closed

build.d: Add checkwhitespace#10499
MoonlightSentinel wants to merge 2 commits intodlang:masterfrom
MoonlightSentinel:check-whitespace

Conversation

@MoonlightSentinel
Copy link
Contributor

@MoonlightSentinel MoonlightSentinel commented Oct 19, 2019

Move checkwhitespace from win32.mak / posix.mak into build.d

TODO: With this patch checkwhitespace apparently considers some additional files which contain windows line ending and fail the check. The last commit temporarily disables this check until this issue is resolved.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @MoonlightSentinel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#10499"

@wilzbach
Copy link
Contributor

TODO: With this patch checkwhitespace apparently considers some additional files which contain windows line ending and fail the check. The last commit temporarily disables this check until this issue is resolved.

Why not fix these files with a separate commit and then directly enable it?

@MoonlightSentinel
Copy link
Contributor Author

Why not fix these files with a separate commit and then directly enable it?

@wilzbach I was not sure wether these files were excluded on purpose but based your reply this seems to be an inconsistency between win32.mak and posix.mak.

I will add another commit but it should probably be merged in another pr(?)

@wilzbach
Copy link
Contributor

I don't think there are only files purposely excluded (though there could be a file in the testsuite which exists solely for checking compatibility with Windows line endings).

It's really fine to do it in this PR. Besides, this way it's better to check that the new check is working.

Copy link
Contributor

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't always need to do a 1:1 translation of the historic Makefile. D gives us more power and flexibility.

@MoonlightSentinel MoonlightSentinel force-pushed the check-whitespace branch 2 times, most recently from ceda259 to b4164a8 Compare October 19, 2019 23:47
@MoonlightSentinel MoonlightSentinel force-pushed the check-whitespace branch 3 times, most recently from 73a1291 to 7b99797 Compare October 20, 2019 16:25
@MoonlightSentinel
Copy link
Contributor Author

What's up with druntime?

std.exception.ErrnoException@std/stdio.d(570): Could not close file `' (Bad file descriptor)
----------------
??:? @safe void std.exception.bailOut!(std.exception.ErrnoException).bailOut(immutable(char)[], uint, scope const(char)[]) [0x80a102e]
??:? @safe bool std.exception.enforce!(std.exception.ErrnoException).enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], uint) [0x2849c182]
??:? @trusted void std.stdio.File.closeHandles() [0x284f94d7]
??:? @trusted void std.stdio.File.detach() [0x284f9bd1]
??:? @safe void std.stdio.File.__dtor() [0x284f90dd]
??:? @trusted void std.process.ProcessPipes.__fieldDtor() [0x284ed891]
??:? std.typecons.Tuple!(int, "status", immutable(char)[], "output").Tuple std.process.executeImpl!(std.process.pipeShell(scope const(char)[], std.process.Redirect, const(immutable(char)[][immutable(char)[]]), std.process.Config, const(char)[], immutable(char)[]), const(char)[], immutable(char)[]).executeImpl(const(char)[], const(immutable(char)[][immutable(char)[]]), std.process.Config, uint, scope const(char)[], immutable(char)[]) [0x284f17d6]
??:? @trusted std.typecons.Tuple!(int, "status", immutable(char)[], "output").Tuple std.process.executeShell(scope const(char)[], const(immutable(char)[][immutable(char)[]]), std.process.Config, uint, scope const(char)[], immutable(char)[]) [0x284edb84]
??:? std.regex.internal.ir.MatcherFactory!(char).MatcherFactory std.regex.internal.ir.defaultFactory!(char).defaultFactory(ref const(std.regex.internal.ir.Regex!(char).Regex)).thompsonFactory [0x809f765]
??:? std.regex.internal.ir.MatcherFactory!(char).MatcherFactory std.regex.internal.ir.defaultFactory!(char).defaultFactory(ref const(std.regex.internal.ir.Regex!(char).Regex)).thompsonFactory [0x80a0369]
??:? const pure nothrow @nogc @safe bool std.regex.internal.ir.Group!(uint).Group.opCast!(bool).opCast() [0x80d20e5]
??:? void std.parallelism.run!(void delegate()).run(void delegate()) [0x284e7db9]
??:? void std.parallelism.Task!(std.parallelism.run, void delegate()).Task.impl(void*) [0x284e7777]
??:? void std.parallelism.AbstractTask.job() [0x284e5ab3]
??:? void std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) [0x284e5d64]
??:? void std.parallelism.TaskPool.executeWorkLoop() [0x284e5f3e]
??:? void std.parallelism.TaskPool.startWorkLoop() [0x284e5ebd]
??:? void core.thread.osthread.Thread.run() [0x28619a78]
??:? thread_entryPoint [0x286187ff]
??:? pthread_create [0x2812fdd9]
??:? ??? [0xffffffff]

@marler8997
Copy link
Contributor

I've already created a PR for this here: #10448

@MoonlightSentinel
Copy link
Contributor Author

I've already created a PR for this here: #10448

Damn, I must have missed that PR, closing.

Maybe you can add @wilzbach's feedback about glob matching to your PR

@marler8997
Copy link
Contributor

I've modified my PR to use glob matching to find all the source files to check whitespace on. #10448

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.

4 participants