mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-15 23:05:40 +00:00
Disallow unreachable_pub
(#4314)
This commit is contained in:
parent
97802e7466
commit
c10a4535b9
444 changed files with 1376 additions and 1106 deletions
|
@ -13,7 +13,7 @@ use ruff::{packaging, resolver, warn_user_once};
|
|||
use crate::args::Overrides;
|
||||
|
||||
/// Add `noqa` directives to a collection of files.
|
||||
pub fn add_noqa(
|
||||
pub(crate) fn add_noqa(
|
||||
files: &[PathBuf],
|
||||
pyproject_config: &PyprojectConfig,
|
||||
overrides: &Overrides,
|
||||
|
|
|
@ -11,7 +11,7 @@ use ruff::logging::LogLevel;
|
|||
use ruff_cache::CACHE_DIR_NAME;
|
||||
|
||||
/// Clear any caches in the current directory or any subdirectories.
|
||||
pub fn clean(level: LogLevel) -> Result<()> {
|
||||
pub(crate) fn clean(level: LogLevel) -> Result<()> {
|
||||
let mut stderr = BufWriter::new(io::stderr().lock());
|
||||
for entry in WalkDir::new(&*path_dedot::CWD)
|
||||
.into_iter()
|
||||
|
|
|
@ -25,7 +25,7 @@ struct LinterCategoryInfo {
|
|||
name: &'static str,
|
||||
}
|
||||
|
||||
pub fn linter(format: HelpFormat) -> Result<()> {
|
||||
pub(crate) fn linter(format: HelpFormat) -> Result<()> {
|
||||
let mut stdout = BufWriter::new(io::stdout().lock());
|
||||
let mut output = String::new();
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
pub mod add_noqa;
|
||||
pub mod clean;
|
||||
pub mod config;
|
||||
pub mod linter;
|
||||
pub mod rule;
|
||||
pub mod run;
|
||||
pub mod run_stdin;
|
||||
pub mod show_files;
|
||||
pub mod show_settings;
|
||||
pub(crate) mod add_noqa;
|
||||
pub(crate) mod clean;
|
||||
pub(crate) mod config;
|
||||
pub(crate) mod linter;
|
||||
pub(crate) mod rule;
|
||||
pub(crate) mod run;
|
||||
pub(crate) mod run_stdin;
|
||||
pub(crate) mod show_files;
|
||||
pub(crate) mod show_settings;
|
||||
|
|
|
@ -16,7 +16,7 @@ struct Explanation<'a> {
|
|||
}
|
||||
|
||||
/// Explain a `Rule` to the user.
|
||||
pub fn rule(rule: Rule, format: HelpFormat) -> Result<()> {
|
||||
pub(crate) fn rule(rule: Rule, format: HelpFormat) -> Result<()> {
|
||||
let (linter, _) = Linter::parse_code(&rule.noqa_code().to_string()).unwrap();
|
||||
let mut stdout = BufWriter::new(io::stdout().lock());
|
||||
let mut output = String::new();
|
||||
|
|
|
@ -25,7 +25,7 @@ use crate::diagnostics::Diagnostics;
|
|||
use crate::panic::catch_unwind;
|
||||
|
||||
/// Run the linter over a collection of files.
|
||||
pub fn run(
|
||||
pub(crate) fn run(
|
||||
files: &[PathBuf],
|
||||
pyproject_config: &PyprojectConfig,
|
||||
overrides: &Overrides,
|
||||
|
|
|
@ -18,7 +18,7 @@ fn read_from_stdin() -> Result<String> {
|
|||
}
|
||||
|
||||
/// Run the linter over a single file, read from `stdin`.
|
||||
pub fn run_stdin(
|
||||
pub(crate) fn run_stdin(
|
||||
filename: Option<&Path>,
|
||||
pyproject_config: &PyprojectConfig,
|
||||
overrides: &Overrides,
|
||||
|
|
|
@ -10,7 +10,7 @@ use ruff::{resolver, warn_user_once};
|
|||
use crate::args::Overrides;
|
||||
|
||||
/// Show the list of files to be checked based on current settings.
|
||||
pub fn show_files(
|
||||
pub(crate) fn show_files(
|
||||
files: &[PathBuf],
|
||||
pyproject_config: &PyprojectConfig,
|
||||
overrides: &Overrides,
|
||||
|
|
|
@ -10,7 +10,7 @@ use ruff::resolver::PyprojectConfig;
|
|||
use crate::args::Overrides;
|
||||
|
||||
/// Print the user-facing configuration settings.
|
||||
pub fn show_settings(
|
||||
pub(crate) fn show_settings(
|
||||
files: &[PathBuf],
|
||||
pyproject_config: &PyprojectConfig,
|
||||
overrides: &Overrides,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue