Skip to content

Conversation

pranlawate
Copy link
Contributor

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 #2412

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>
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.19%. Comparing base (6326226) to head (2b2e572).
⚠️ Report is 6 commits behind head on main.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@DanielNoord DanielNoord left a 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?

@pranlawate
Copy link
Contributor Author

Thanks for reviewing this PR.
I am still fairly new with Python devlopement so I honestly don't know which is better to use.

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.
I think I can raise another PR for using either os.path or Path throughout the code by studying which is more suitable for isort to have more uniformity. Will prove a good improvement for me as well as the code if you would like that.

Copy link
Member

@DanielNoord DanielNoord left a 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 :)

@DanielNoord DanielNoord added this pull request to the merge queue Oct 5, 2025
Merged via the queue into PyCQA:main with commit b880632 Oct 5, 2025
21 checks passed
luketainton pushed a commit to luketainton/roboluke-tasks that referenced this pull request Oct 13, 2025
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` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/isort/7.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/isort/6.1.0/7.0.0?slim=true)](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 ([#&#8203;2430](PyCQA/isort#2430)) [@&#8203;DanielNoord](https://github.com/DanielNoord)

#### 🚀 Features

- Show absolute paths in skipped file messages ([#&#8203;2416](PyCQA/isort#2416)) [@&#8203;pranlawate](https://github.com/pranlawate)

#### 🪲 Fixes

- Some fixes for Python 3.14 ([#&#8203;2433](PyCQA/isort#2433)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- Test on `3.14` and fix any bugs ([#&#8203;2425](PyCQA/isort#2425)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- Update CHANGELOG.md + Fix Formatting and Grammar ([#&#8203;2419](PyCQA/isort#2419)) [@&#8203;lukbrew25](https://github.com/lukbrew25)
- Fix output of hanging indent for long lines with noqa ([#&#8203;2407](PyCQA/isort#2407)) [@&#8203;matan1008](https://github.com/matan1008)

#### :construction\_worker: Continuous Integration

- Format with `ruff` instead of `black` ([#&#8203;2432](PyCQA/isort#2432)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- Target 3.10 for `ruff` ([#&#8203;2431](PyCQA/isort#2431)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- Update development dependencies to latest version ([#&#8203;2426](PyCQA/isort#2426)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- docs: update pre-commit examples to version 6.1.0 ([#&#8203;2413](PyCQA/isort#2413)) [@&#8203;pranlawate](https://github.com/pranlawate)
- Small cleanup for developer environment ([#&#8203;2418](PyCQA/isort#2418)) [@&#8203;DanielNoord](https://github.com/DanielNoord)

#### 📦 Dependencies

- Bump actions/setup-python from 5 to 6 in the github-actions group ([#&#8203;2411](PyCQA/isort#2411)) @&#8203;[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>
luketainton pushed a commit to luketainton/epage that referenced this pull request Oct 13, 2025
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` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/isort/7.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/isort/6.1.0/7.0.0?slim=true)](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 ([#&#8203;2430](PyCQA/isort#2430)) [@&#8203;DanielNoord](https://github.com/DanielNoord)

#### 🚀 Features

- Show absolute paths in skipped file messages ([#&#8203;2416](PyCQA/isort#2416)) [@&#8203;pranlawate](https://github.com/pranlawate)

#### 🪲 Fixes

- Some fixes for Python 3.14 ([#&#8203;2433](PyCQA/isort#2433)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- Test on `3.14` and fix any bugs ([#&#8203;2425](PyCQA/isort#2425)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- Update CHANGELOG.md + Fix Formatting and Grammar ([#&#8203;2419](PyCQA/isort#2419)) [@&#8203;lukbrew25](https://github.com/lukbrew25)
- Fix output of hanging indent for long lines with noqa ([#&#8203;2407](PyCQA/isort#2407)) [@&#8203;matan1008](https://github.com/matan1008)

#### :construction\_worker: Continuous Integration

- Format with `ruff` instead of `black` ([#&#8203;2432](PyCQA/isort#2432)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- Target 3.10 for `ruff` ([#&#8203;2431](PyCQA/isort#2431)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- Update development dependencies to latest version ([#&#8203;2426](PyCQA/isort#2426)) [@&#8203;DanielNoord](https://github.com/DanielNoord)
- docs: update pre-commit examples to version 6.1.0 ([#&#8203;2413](PyCQA/isort#2413)) [@&#8203;pranlawate](https://github.com/pranlawate)
- Small cleanup for developer environment ([#&#8203;2418](PyCQA/isort#2418)) [@&#8203;DanielNoord](https://github.com/DanielNoord)

#### 📦 Dependencies

- Bump actions/setup-python from 5 to 6 in the github-actions group ([#&#8203;2411](PyCQA/isort#2411)) @&#8203;[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>
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.

--verbose does not show full path to skipped file

2 participants