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:
Charlie Marsh 2023-08-02 13:25:43 -04:00 committed by GitHub
parent 8a0f844642
commit 041946fb64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 148 additions and 209 deletions

View file

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