Skip to content
This repository was archived by the owner on Oct 14, 2021. It is now read-only.

Commit bfa2ec1

Browse files
committed
Make the grammar tests module a separate module from the grammar module
This way we can run clippy only this module without running it on the grammar module itself.
1 parent 223c160 commit bfa2ec1

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

starlark/src/syntax/grammar.tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use super::StarlarkParser;
15+
use syntax::grammar::StarlarkParser;
1616
use std::sync::{Arc, Mutex};
1717
use syntax::ast::Statement;
1818
use syntax::dialect::Dialect;

starlark/src/syntax/mod.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ pub mod lexer;
3030
#[allow(clippy::all)]
3131
mod grammar {
3232
include!(concat!(env!("OUT_DIR"), "/syntax/grammar.rs"));
33-
// TODO(damienmg): there doesn't seem to have a way to reactivate default
34-
// clippy warning / errors only for the tests...
35-
#[cfg(test)]
36-
mod tests {
37-
include!(concat!(
38-
env!("CARGO_MANIFEST_DIR"),
39-
"/src/syntax/grammar.tests.rs"
40-
));
41-
}
33+
}
34+
35+
// TODO(damienmg): there doesn't seem to have a way to reactivate default
36+
// clippy warning / errors only for the tests...
37+
#[cfg(test)]
38+
mod grammar_tests {
39+
include!(concat!(
40+
env!("CARGO_MANIFEST_DIR"),
41+
"/src/syntax/grammar.tests.rs"
42+
));
4243
}
4344

4445
#[doc(hidden)]

0 commit comments

Comments
 (0)