Skip to content
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

slither-doctor: PATH checks #1550

Merged
merged 11 commits into from
Jan 9, 2023
Merged

slither-doctor: PATH checks #1550

merged 11 commits into from
Jan 9, 2023

Conversation

elopez
Copy link
Member

@elopez elopez commented Jan 4, 2023

This PR adds a new check to slither-doctor, that validates if $PATH is set correctly in the system.

When all looks good, it will print the following:

Screenshot 2023-01-04 at 20 18 06

However, if the path is misconfigured it will print a red message and suggest a folder you should add to $PATH (for this example I broke my PATH config on purpose). Users can run slither-doctor as python3 -m slither.tools.doctor even if their PATH is misconfigured:

Screenshot 2023-01-04 at 20 20 41

This will also warn if you somehow have another Slither installation earlier in PATH (exemplified here by running slither-doctor from a non-activated venv, while there's a system-wide installation of slither)

Screenshot 2023-01-04 at 20 24 26

@elopez elopez force-pushed the dev-doctor-paths branch 4 times, most recently from e1c5bd5 to 9a14d41 Compare January 4, 2023 22:51
elopez added 10 commits January 4, 2023 20:10
This was used just for typing, and it was removed in a recent `packaging`
version, so remove the LegacyVersion import. Also declare the missing
`packaging` dependency in setup.py
This ensures PATH is correctly configured, and hints the user about
what they might need to do to configure it correctly.
This avoids mixed output in e.g. CI outputs
@elopez elopez marked this pull request as ready for review January 4, 2023 23:34
@montyly montyly merged commit 0fd24c0 into dev Jan 9, 2023
@montyly montyly deleted the dev-doctor-paths branch January 9, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants