Commit a7eb5af 1 parent bd05a8a commit a7eb5af Copy full SHA for a7eb5af
File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,8 @@ pub fn resolve_configuration(
127
127
}
128
128
129
129
// Resolve the current path.
130
- let options = pyproject:: load_options ( & path) ?;
130
+ let options = pyproject:: load_options ( & path)
131
+ . map_err ( |err| anyhow ! ( "Failed to parse `{}`: {}" , path. to_string_lossy( ) , err) ) ?;
131
132
let project_root = relativity. resolve ( & path) ;
132
133
let configuration = Configuration :: from_options ( options, & project_root) ?;
133
134
Original file line number Diff line number Diff line change 2
2
3
3
use std:: path:: { Path , PathBuf } ;
4
4
5
- use anyhow:: { anyhow , Result } ;
5
+ use anyhow:: Result ;
6
6
use serde:: { Deserialize , Serialize } ;
7
7
8
8
use crate :: settings:: options:: Options ;
@@ -113,13 +113,7 @@ pub fn find_user_settings_toml() -> Option<PathBuf> {
113
113
/// Load `Options` from a `pyproject.toml` or `ruff.toml` file.
114
114
pub fn load_options < P : AsRef < Path > > ( path : P ) -> Result < Options > {
115
115
if path. as_ref ( ) . ends_with ( "pyproject.toml" ) {
116
- let pyproject = parse_pyproject_toml ( & path) . map_err ( |err| {
117
- anyhow ! (
118
- "Failed to parse `{}`: {}" ,
119
- path. as_ref( ) . to_string_lossy( ) ,
120
- err
121
- )
122
- } ) ?;
116
+ let pyproject = parse_pyproject_toml ( & path) ?;
123
117
Ok ( pyproject
124
118
. tool
125
119
. and_then ( |tool| tool. ruff )
You can’t perform that action at this time.
0 commit comments