-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Rename venv-path to python
#16347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Rename venv-path to python
#16347
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ use red_knot_project::{watch, Db}; | |
| use red_knot_project::{ProjectDatabase, ProjectMetadata}; | ||
| use red_knot_server::run_server; | ||
| use ruff_db::diagnostic::{Diagnostic, DisplayDiagnosticConfig, Severity}; | ||
| use ruff_db::system::{OsSystem, System, SystemPath, SystemPathBuf}; | ||
| use ruff_db::system::{OsSystem, SystemPath, SystemPathBuf}; | ||
| use salsa::plumbing::ZalsaDatabase; | ||
|
|
||
| mod args; | ||
|
|
@@ -69,7 +69,7 @@ fn run_check(args: CheckCommand) -> anyhow::Result<ExitStatus> { | |
| let _guard = setup_tracing(verbosity)?; | ||
|
|
||
| // The base path to which all CLI arguments are relative to. | ||
| let cli_base_path = { | ||
| let cwd = { | ||
| let cwd = std::env::current_dir().context("Failed to get the current working directory")?; | ||
| SystemPathBuf::from_path_buf(cwd) | ||
| .map_err(|path| { | ||
|
|
@@ -80,25 +80,27 @@ fn run_check(args: CheckCommand) -> anyhow::Result<ExitStatus> { | |
| })? | ||
| }; | ||
|
|
||
| let cwd = args | ||
| let project_path = args | ||
| .project | ||
| .as_ref() | ||
| .map(|cwd| { | ||
| if cwd.as_std_path().is_dir() { | ||
| Ok(SystemPath::absolute(cwd, &cli_base_path)) | ||
| .map(|project| { | ||
| if project.as_std_path().is_dir() { | ||
| Ok(SystemPath::absolute(project, &cwd)) | ||
| } else { | ||
| Err(anyhow!("Provided project path `{cwd}` is not a directory")) | ||
| Err(anyhow!( | ||
| "Provided project path `{project}` is not a directory" | ||
| )) | ||
| } | ||
| }) | ||
| .transpose()? | ||
| .unwrap_or_else(|| cli_base_path.clone()); | ||
| .unwrap_or_else(|| cwd.clone()); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed while testing that relative path arguments on the CLI were incorrectly anchored to the project directory instead of the cwd. For example, the |
||
|
|
||
| let system = OsSystem::new(cwd); | ||
| let watch = args.watch; | ||
| let exit_zero = args.exit_zero; | ||
|
|
||
| let cli_options = args.into_options(); | ||
| let mut project_metadata = ProjectMetadata::discover(system.current_directory(), &system)?; | ||
| let mut project_metadata = ProjectMetadata::discover(&project_path, &system)?; | ||
| project_metadata.apply_cli_options(cli_options.clone()); | ||
| project_metadata.apply_configuration_files(&system)?; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems out of date (or at least badly located) now?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still true. We relativize the paths in
RelativePathBuf::absolute. The main change here is that we don't use the project path ascwdwhen it is set (which is incorrect)