Disallow unreachable_pub (#4314)

This commit is contained in:
Jonathan Plasse 2023-05-12 00:00:00 +02:00 committed by GitHub
parent 97802e7466
commit c10a4535b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
444 changed files with 1376 additions and 1106 deletions

View file

@ -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,

View file

@ -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()

View file

@ -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();

View file

@ -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;

View file

@ -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();

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,