mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:53 +00:00
Disallow unreachable_pub
(#4314)
This commit is contained in:
parent
97802e7466
commit
c10a4535b9
444 changed files with 1376 additions and 1106 deletions
|
@ -8,13 +8,13 @@ use anyhow::Result;
|
|||
use rustpython_parser as parser;
|
||||
|
||||
#[derive(clap::Args)]
|
||||
pub struct Args {
|
||||
pub(crate) struct Args {
|
||||
/// Python file for which to generate the AST.
|
||||
#[arg(required = true)]
|
||||
file: PathBuf,
|
||||
}
|
||||
|
||||
pub fn main(args: &Args) -> Result<()> {
|
||||
pub(crate) fn main(args: &Args) -> Result<()> {
|
||||
let contents = fs::read_to_string(&args.file)?;
|
||||
let python_ast = parser::parse_program(&contents, &args.file.to_string_lossy())?;
|
||||
println!("{python_ast:#?}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue