Split off ruff_cli crate from ruff library

This lets you test the ruff linters or use the ruff library
without having to compile the ~100 additional dependencies
that are needed by the CLI.

Because we set the following in the [workspace] section of Cargo.toml:

   default-members = [".", "ruff_cli"]

`cargo run` still runs the CLI and `cargo test` still tests
the code in src/ as well as the code in the new ruff_cli crate.
(But you can now also run `cargo test -p ruff` to only test the linters.)
This commit is contained in:
Martin Fischer
2023-01-12 13:10:33 +01:00
committed by Charlie Marsh
parent 403a004e03
commit 82aff5f9ec
27 changed files with 330 additions and 282 deletions

View File

@@ -5,7 +5,7 @@ use rustpython_parser::mode::Mode;
use rustpython_parser::{lexer, parser};
/// Collect tokens up to and including the first error.
pub(crate) fn tokenize(contents: &str) -> Vec<LexResult> {
pub fn tokenize(contents: &str) -> Vec<LexResult> {
let mut tokens: Vec<LexResult> = vec![];
for tok in lexer::make_tokenizer(contents) {
let is_err = tok.is_err();