@@ -111,6 +111,7 @@ pub fn check(path: &Path, bad: &mut bool) {
111
111
let skip_tab = contents. contains ( "ignore-tidy-tab" ) ;
112
112
let skip_length = contents. contains ( "ignore-tidy-linelength" ) ;
113
113
let skip_end_whitespace = contents. contains ( "ignore-tidy-end-whitespace" ) ;
114
+ let skip_copyright = contents. contains ( "ignore-tidy-copyright" ) ;
114
115
let mut trailing_new_lines = 0 ;
115
116
for ( i, line) in contents. split ( '\n' ) . enumerate ( ) {
116
117
let mut err = |msg : & str | {
@@ -120,13 +121,13 @@ pub fn check(path: &Path, bad: &mut bool) {
120
121
&& !long_line_is_ok ( line) {
121
122
err ( & format ! ( "line longer than {} chars" , COLS ) ) ;
122
123
}
123
- if line. contains ( '\t' ) && !skip_tab {
124
+ if !skip_tab && line. contains ( '\t' ) {
124
125
err ( "tab character" ) ;
125
126
}
126
127
if !skip_end_whitespace && ( line. ends_with ( ' ' ) || line. ends_with ( '\t' ) ) {
127
128
err ( "trailing whitespace" ) ;
128
129
}
129
- if line. contains ( '\r' ) && !skip_cr {
130
+ if !skip_cr && line. contains ( '\r' ) {
130
131
err ( "CR character" ) ;
131
132
}
132
133
if filename != "style.rs" {
@@ -137,6 +138,13 @@ pub fn check(path: &Path, bad: &mut bool) {
137
138
err ( "XXX is deprecated; use FIXME" )
138
139
}
139
140
}
141
+ if !skip_copyright && ( line. starts_with ( "// Copyright" ) ||
142
+ line. starts_with ( "# Copyright" ) ||
143
+ line. starts_with ( "Copyright" ) )
144
+ && ( line. contains ( "Rust Developers" ) ||
145
+ line. contains ( "Rust Project Developers" ) ) {
146
+ err ( "copyright notices attributed to the Rust Project Developers are deprecated" ) ;
147
+ }
140
148
if line. ends_with ( "```ignore" ) || line. ends_with ( "```rust,ignore" ) {
141
149
err ( UNEXPLAINED_IGNORE_DOCTEST_INFO ) ;
142
150
}
0 commit comments