-
-
Notifications
You must be signed in to change notification settings - Fork 613
Show absolute paths in skipped file messages #2416
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
Show absolute paths in skipped file messages #2416
Conversation
When files are skipped, isort now displays their absolute paths in verbose mode, consistent with the "Fixing" messages. This improves debugging by making it clear which files are being skipped. Changes: - isort/main.py:1178 - Convert file_name to absolute path before appending - isort/files.py:24 - Use full_path instead of just dirname - isort/files.py:35 - Use absolute filepath instead of just filename Fixes PyCQA#2412 Signed-off-by: Pranav Lawate <pran.lawate@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2416 +/- ##
=======================================
Coverage 99.19% 99.19%
=======================================
Files 40 40
Lines 3101 3101
Branches 680 680
=======================================
Hits 3076 3076
Misses 14 14
Partials 11 11 🚀 New features to boost your workflow:
|
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.
Do you have a particular reason for using os.path
and Path
?
Thanks for reviewing this PR. I tried to use what's present in the nearby lines of where I changed the code. In files.py line 34 uses os.path so I used the same on 35th and in main.py 1177 line uses Path so I used that on 1178. I generally like using Path myself so I can make both lines use that or if you would prefer os.path, then I can use that as well. |
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.
Could indeed be nice to do a followup to use Path
everywhere.
If you do so, please make sure to do not do everything in a big PR. Those are more likely to stall due to maintainers never having enough time to review big PRs.
Small PRs like this can be easily reviewed with little effort and merged to main
soon :)
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [isort](https://github.com/PyCQA/isort) ([changelog](https://github.com/PyCQA/isort/releases)) | `<6.1.1,>=6.1.0` -> `<7.0.1,>=7.0.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>PyCQA/isort (isort)</summary> ### [`v7.0.0`](https://github.com/PyCQA/isort/releases/tag/7.0.0) [Compare Source](PyCQA/isort@6.1.0...7.0.0) #### Changes #### 💥 Breaking Changes - Drop support for Python 3.9 ([#​2430](PyCQA/isort#2430)) [@​DanielNoord](https://github.com/DanielNoord) #### 🚀 Features - Show absolute paths in skipped file messages ([#​2416](PyCQA/isort#2416)) [@​pranlawate](https://github.com/pranlawate) #### 🪲 Fixes - Some fixes for Python 3.14 ([#​2433](PyCQA/isort#2433)) [@​DanielNoord](https://github.com/DanielNoord) - Test on `3.14` and fix any bugs ([#​2425](PyCQA/isort#2425)) [@​DanielNoord](https://github.com/DanielNoord) - Update CHANGELOG.md + Fix Formatting and Grammar ([#​2419](PyCQA/isort#2419)) [@​lukbrew25](https://github.com/lukbrew25) - Fix output of hanging indent for long lines with noqa ([#​2407](PyCQA/isort#2407)) [@​matan1008](https://github.com/matan1008) #### :construction\_worker: Continuous Integration - Format with `ruff` instead of `black` ([#​2432](PyCQA/isort#2432)) [@​DanielNoord](https://github.com/DanielNoord) - Target 3.10 for `ruff` ([#​2431](PyCQA/isort#2431)) [@​DanielNoord](https://github.com/DanielNoord) - Update development dependencies to latest version ([#​2426](PyCQA/isort#2426)) [@​DanielNoord](https://github.com/DanielNoord) - docs: update pre-commit examples to version 6.1.0 ([#​2413](PyCQA/isort#2413)) [@​pranlawate](https://github.com/pranlawate) - Small cleanup for developer environment ([#​2418](PyCQA/isort#2418)) [@​DanielNoord](https://github.com/DanielNoord) #### 📦 Dependencies - Bump actions/setup-python from 5 to 6 in the github-actions group ([#​2411](PyCQA/isort#2411)) @​[dependabot\[bot\]](https://github.com/apps/dependabot) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDYuMCIsInVwZGF0ZWRJblZlciI6IjQxLjE0Ni4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==--> Reviewed-on: https://git.tainton.uk/repos/roboluke/pulls/383 Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [isort](https://github.com/PyCQA/isort) ([changelog](https://github.com/PyCQA/isort/releases)) | `<6.1.1,>=6.1.0` -> `<7.0.1,>=7.0.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>PyCQA/isort (isort)</summary> ### [`v7.0.0`](https://github.com/PyCQA/isort/releases/tag/7.0.0) [Compare Source](PyCQA/isort@6.1.0...7.0.0) #### Changes #### 💥 Breaking Changes - Drop support for Python 3.9 ([#​2430](PyCQA/isort#2430)) [@​DanielNoord](https://github.com/DanielNoord) #### 🚀 Features - Show absolute paths in skipped file messages ([#​2416](PyCQA/isort#2416)) [@​pranlawate](https://github.com/pranlawate) #### 🪲 Fixes - Some fixes for Python 3.14 ([#​2433](PyCQA/isort#2433)) [@​DanielNoord](https://github.com/DanielNoord) - Test on `3.14` and fix any bugs ([#​2425](PyCQA/isort#2425)) [@​DanielNoord](https://github.com/DanielNoord) - Update CHANGELOG.md + Fix Formatting and Grammar ([#​2419](PyCQA/isort#2419)) [@​lukbrew25](https://github.com/lukbrew25) - Fix output of hanging indent for long lines with noqa ([#​2407](PyCQA/isort#2407)) [@​matan1008](https://github.com/matan1008) #### :construction\_worker: Continuous Integration - Format with `ruff` instead of `black` ([#​2432](PyCQA/isort#2432)) [@​DanielNoord](https://github.com/DanielNoord) - Target 3.10 for `ruff` ([#​2431](PyCQA/isort#2431)) [@​DanielNoord](https://github.com/DanielNoord) - Update development dependencies to latest version ([#​2426](PyCQA/isort#2426)) [@​DanielNoord](https://github.com/DanielNoord) - docs: update pre-commit examples to version 6.1.0 ([#​2413](PyCQA/isort#2413)) [@​pranlawate](https://github.com/pranlawate) - Small cleanup for developer environment ([#​2418](PyCQA/isort#2418)) [@​DanielNoord](https://github.com/DanielNoord) #### 📦 Dependencies - Bump actions/setup-python from 5 to 6 in the github-actions group ([#​2411](PyCQA/isort#2411)) @​[dependabot\[bot\]](https://github.com/apps/dependabot) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDYuMCIsInVwZGF0ZWRJblZlciI6IjQxLjE0Ni4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==--> Reviewed-on: https://git.tainton.uk/repos/epage/pulls/167 Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
When files are skipped, isort now displays their absolute paths in verbose mode, consistent with the "Fixing" messages. This improves debugging by making it clear which files are being skipped.
Changes:
Fixes #2412