Skip to content

Add lint for copyright headers to 'tidy' tool #57520

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

Merged
merged 4 commits into from
Jan 17, 2019

Conversation

alexreg
Copy link
Contributor

@alexreg alexreg commented Jan 11, 2019

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 11, 2019
@rust-highfive

This comment has been minimized.

@alexreg
Copy link
Contributor Author

alexreg commented Jan 11, 2019

Looks to be working. I’ll fix those files shortly.

@rust-highfive

This comment has been minimized.

@Mark-Simulacrum
Copy link
Member

Looks like Travis failed but this looks good to me in general - it might be worth including a check for "Rust" in the copyright line?

@alexreg
Copy link
Contributor Author

alexreg commented Jan 11, 2019

Looks like Travis failed but this looks good to me in general - it might be worth including a check for "Rust" in the copyright line?

Yep, I actually went further than this and made a regex for the copyright line, but let me know if that's overkill...

@rust-highfive

This comment has been minimized.

@Mark-Simulacrum
Copy link
Member

I think the regex is a bit overkill - especially because as far as I can tell it can be replaced with ~3 contains nearly equivalently. But if that's not actually the case, then let's put it in a lazy_static and call it good.

@alexreg
Copy link
Contributor Author

alexreg commented Jan 12, 2019

Yeah, I thought originally I would need a more complicated regex to distinguish between Rust Developers and other sorts of copyright notices, but probably not. Let's see if this works...

@rust-highfive

This comment has been minimized.

@alexreg
Copy link
Contributor Author

alexreg commented Jan 12, 2019

@Mark-Simulacrum Looking good now. (Tidy checks would have failed this far into the tests.) r+ if you're happy with things?

@Mark-Simulacrum
Copy link
Member

r=me with notes fixed.

Thanks for taking this on!

Let's also @bors p=1 to hopefully help avoid some rebase pain.

@alexreg
Copy link
Contributor Author

alexreg commented Jan 12, 2019

@Mark-Simulacrum LGTM?

@bors
Copy link
Collaborator

bors commented Jan 12, 2019

@alexreg: 🔑 Insufficient privileges: Not in reviewers

@alexreg
Copy link
Contributor Author

alexreg commented Jan 12, 2019

@Mark-Simulacrum Did your above r=me have any meaning to Bors or just a reminder?

Also, @nikomatsakis, was I added to the reviewers list yet? I tried to do @bors r=@Mark-Simulacrum p=1...

@bors
Copy link
Collaborator

bors commented Jan 12, 2019

@alexreg: 🔑 Insufficient privileges: not in try users

@bors

This comment has been minimized.

@alexreg
Copy link
Contributor Author

alexreg commented Jan 12, 2019

(Ugh, @bors should really ignore commands within backticks.)

@Mark-Simulacrum
Copy link
Member

Okay one last nit that I noticed, r=me now

I think we haven't re-deployed bors yet so the configuration hasn't been reloaded. For now, @bors delegate+

@bors
Copy link
Collaborator

bors commented Jan 12, 2019

✌️ @alexreg can now approve this pull request

@alexreg
Copy link
Contributor Author

alexreg commented Jan 12, 2019

@Mark-Simulacrum Ah, that makes sense. Thanks for delegating.

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Jan 12, 2019

📌 Commit e46028aca974c8d7a9ca4e0336268d4023fa212c has been approved by alexreg

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 12, 2019
@alexreg
Copy link
Contributor Author

alexreg commented Jan 12, 2019

Oops, I meant @bors r=@Mark-Simulacrum p=1

@bors
Copy link
Collaborator

bors commented Jan 12, 2019

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Jan 12, 2019

📌 Commit e46028aca974c8d7a9ca4e0336268d4023fa212c has been approved by @Mark-Simulacrum

@rust-highfive

This comment has been minimized.

@Centril
Copy link
Contributor

Centril commented Jan 13, 2019

@bors retry

@bors
Copy link
Collaborator

bors commented Jan 13, 2019

📌 Commit 60c8837fde3a9c219c4434eec1e45b120382451f has been approved by Mark-Simulacrum

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:01a24622:start=1547342162023436215,finish=1547342243260738161,duration=81237301946
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---

[00:03:21] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/convert-quotes.sh:2: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/nostarch.sh:2: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/tools/src/bin/convert_quotes.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/tools/src/bin/remove_links.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/tools/src/bin/link2print.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/tools/src/bin/concat_chapters.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/tools/src/bin/remove_markup.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/tools/src/bin/lfp.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/second-edition/doc-to-md.sh:2: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/convert-quotes.sh:2: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/nostarch.sh:2: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/ci/build.sh:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/ci/stable-check/src/main.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/ci/spellcheck.sh:2: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/2018-edition/convert-quotes.sh:2: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/2018-edition/nostarch.sh:2: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/2018-edition/tools/src/bin/convert_quotes.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/2018-edition/tools/src/bin/remove_links.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/2018-edition/tools/src/bin/link2print.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/2018-edition/tools/src/bin/concat_chapters.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/2018-edition/tools/src/bin/remove_markup.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/2018-edition/tools/src/bin/lfp.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/tools/src/bin/convert_quotes.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/tools/src/bin/remove_links.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/tools/src/bin/link2print.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/tools/src/bin/concat_chapters.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/tools/src/bin/remove_markup.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/book/tools/src/bin/lfp.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:21] tidy error: /checkout/src/doc/reference/stable-check/src/main.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:22] tidy error: /checkout/src/test/ui/feature-gates/feature-gate-type_alias_enum_variants.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:22] tidy error: /checkout/src/test/rustdoc/no-crate-filter.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:22] tidy error: /checkout/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:22] tidy error: /checkout/src/test/rustdoc-ui/deny-missing-docs-crate.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:22] tidy error: /checkout/src/test/rustdoc-ui/deny-missing-docs-macro.rs:1: copyright notices attributed to the Rust Project Developers are deprecated
[00:03:23] 
[00:03:23] 
[00:03:23] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:23] 
[00:03:23] 
[00:03:23] some tidy checks failed
[00:03:23] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:23] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:23] Build completed unsuccessfully in 0:00:48
[00:03:23] Makefile:69: recipe for target 'tidy' failed
[00:03:23] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0f142463
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Jan 13 01:20:55 UTC 2019
---
travis_time:end:091bf60a:start=1547342456021201712,finish=1547342456026292739,duration=5091027
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:01a689b0
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:2ea5549c
travis_time:start:2ea5549c
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0e0f4ecc
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Mark-Simulacrum
Copy link
Member

@bors r- (since Travis failed)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 13, 2019
@alexreg
Copy link
Contributor Author

alexreg commented Jan 13, 2019

@Mark-Simulacrum Fair enough. Do you have merge rights on the Book? It turns out there are some copyright notices in the code there blocking it. rust-lang/book#1765 fixes it, so maybe you could approve that if possible (once CI passes)...

@Mark-Simulacrum
Copy link
Member

Merged book PR.

@alexreg
Copy link
Contributor Author

alexreg commented Jan 13, 2019

@Mark-Simulacrum Okay, everything should be good now. Just r+ when Travis goes green please. :-)

@rust-highfive

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jan 13, 2019

☔ The latest upstream changes (presumably #57568) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-highfive

This comment has been minimized.

@alexreg
Copy link
Contributor Author

alexreg commented Jan 13, 2019

@Mark-Simulacrum @Centril I don't get the above errors when running locally... what's going on?

@rust-highfive

This comment has been minimized.

@alexreg
Copy link
Contributor Author

alexreg commented Jan 13, 2019

@Mark-Simulacrum @rust-lang/docs Could one of you kindly fix the links in the book, per above, so we can get this merged? Thanks.

@carols10cents
Copy link
Member

@alexreg The broken links in the book should be fixed now: rust-lang/book@0e9061c

@alexreg
Copy link
Contributor Author

alexreg commented Jan 16, 2019

@carols10cents Thanks a lot. I'll go ahead and update the submodule in this PR then. Appreciate you working with us despite that surprising merge to your repo over the weekend!

@alexreg
Copy link
Contributor Author

alexreg commented Jan 16, 2019

@Mark-Simulacrum @Centril Okay, this should be ready to merge now... when CI passes, at least.

@Centril
Copy link
Contributor

Centril commented Jan 17, 2019

@bors r=Mark-Simulacrum p=10

@bors
Copy link
Collaborator

bors commented Jan 17, 2019

📌 Commit 4d18023 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 17, 2019
@bors
Copy link
Collaborator

bors commented Jan 17, 2019

⌛ Testing commit 4d18023 with merge 6599946...

bors added a commit that referenced this pull request Jan 17, 2019
@bors bors mentioned this pull request Jan 17, 2019
@bors
Copy link
Collaborator

bors commented Jan 17, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Mark-Simulacrum
Pushing 6599946 to master...

@bors bors merged commit 4d18023 into rust-lang:master Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants