Remove CallArguments abstraction (#6279)
## Summary This PR removes a now-unnecessary abstraction from `helper.rs` (`CallArguments`), in favor of adding methods to `Arguments` directly, which helps with discoverability.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use ruff_python_ast::{self as ast, Expr, Keyword};
|
||||
|
||||
use ruff_python_ast::call_path::{collect_call_path, from_qualified_name};
|
||||
use ruff_python_ast::helpers::{find_keyword, is_const_true};
|
||||
use ruff_python_ast::helpers::is_const_true;
|
||||
use ruff_python_ast::{self as ast, Arguments, Expr, Keyword};
|
||||
|
||||
use crate::model::SemanticModel;
|
||||
|
||||
@@ -61,8 +60,8 @@ pub fn is_logger_candidate(
|
||||
|
||||
/// If the keywords to a logging call contain `exc_info=True` or `exc_info=sys.exc_info()`,
|
||||
/// return the `Keyword` for `exc_info`.
|
||||
pub fn exc_info<'a>(keywords: &'a [Keyword], semantic: &SemanticModel) -> Option<&'a Keyword> {
|
||||
let exc_info = find_keyword(keywords, "exc_info")?;
|
||||
pub fn exc_info<'a>(arguments: &'a Arguments, semantic: &SemanticModel) -> Option<&'a Keyword> {
|
||||
let exc_info = arguments.find_keyword("exc_info")?;
|
||||
|
||||
// Ex) `logging.error("...", exc_info=True)`
|
||||
if is_const_true(&exc_info.value) {
|
||||
|
||||
Reference in New Issue
Block a user