In the current implementation, the script uses a hardcoded relative file path, which makes it dependent on the current working directory. This approach can lead to issues when the script is run from different directories or environments. To improve the robustness and portability of the script, it is recommended to use an absolute path based on the user's home directory or a designated configuration directory.
Suggested Fix:
Refactor the script to determine the file path dynamically using environment variables or libraries like os.path or pathlib in Python.
Consider storing configuration files in a standard location, such as the user's home directory or a dedicated configuration directory, to ensure consistent access across different environments.
Action Items:
Identify all instances where relative paths are used in the script.
Implement a strategy to convert these to absolute paths.
Test the script in different environments to ensure the changes work as expected.
Tips and commands
#### Interacting with Sourcery
- **Generate a plan of action:** Comment `@sourcery-ai plan` on this issue.
- **Generate a pull request for this issue:** Comment `@sourcery-ai develop` to
generate a PR that addresses this issue.
#### Getting Help
- [Contact our support team](mailto:support@sourcery.ai) for questions or feedback.
- Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information.
- Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
In the current implementation, the script uses a hardcoded relative file path, which makes it dependent on the current working directory. This approach can lead to issues when the script is run from different directories or environments. To improve the robustness and portability of the script, it is recommended to use an absolute path based on the user's home directory or a designated configuration directory.
Suggested Fix:
os.path
orpathlib
in Python.Action Items:
I created this issue for @bartczak-pa from https://github.com/bartczak-pa/projects-roadmap-sh/pull/5#discussion_r1818131317.
Tips and commands
#### Interacting with Sourcery - **Generate a plan of action:** Comment `@sourcery-ai plan` on this issue. - **Generate a pull request for this issue:** Comment `@sourcery-ai develop` to generate a PR that addresses this issue. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).