-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f66f2cf
commit 7aa60a4
Showing
7 changed files
with
105 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! A test suite that ensures deprecated command line options have appropriate warnings / behaviors | ||
use ruff_linter::settings::types::OutputFormat; | ||
use std::process::Command; | ||
|
||
use insta_cmd::{assert_cmd_snapshot, get_cargo_bin}; | ||
|
||
const BIN_NAME: &str = "ruff"; | ||
|
||
const STDIN: &str = "l = 1"; | ||
|
||
fn ruff_check(output_format: OutputFormat) -> Command { | ||
let mut cmd = Command::new(get_cargo_bin(BIN_NAME)); | ||
let output_format = output_format.to_string(); | ||
cmd.arg("check") | ||
.arg("--output-format") | ||
.arg(output_format) | ||
.arg("--no-cache"); | ||
cmd.arg("-"); | ||
|
||
cmd | ||
} | ||
|
||
#[test] | ||
#[allow(deprecated)] | ||
fn ensure_output_format_is_deprecated() { | ||
assert_cmd_snapshot!(ruff_check(OutputFormat::Text).pass_stdin(STDIN), @r###" | ||
success: false | ||
exit_code: 1 | ||
----- stdout ----- | ||
-:1:1: E741 Ambiguous variable name: `l` | ||
Found 1 error. | ||
----- stderr ----- | ||
warning: `--output-format=text` is deprecated. Use `--output-format=full` or `--output-format=concise` instead. `text` will be treated as `concise`. | ||
"###); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.