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

fix: further improve file path handling #479

Merged
merged 6 commits into from
Apr 1, 2022

Conversation

mjpieters
Copy link
Contributor

  • On Windows, reflection of file URLs to paths requires that we know about the URL hostname too as they could be UNC paths.
  • Add some tests that verify that we are round-tripping from Path to URL and back again correctly.
  • Simplify scheme testing for relative URLs, we only need to know about supported schemes.

Checklist

  • Read the contribution guidelines
  • Run make locally before pushing commits
  • Add tests for the relevant parts:
    • API
    • CLI
    • flake8 plugin (normal mode)
    • flake8 plugin (offline mode)
  • Write documentation when there's a new API or functionality

- On Windows, reflection of file URLs to paths requires that we know about the URL hostname too as they could be UNC paths.
- Add some tests that verify that we are round-tripping from Path to URL and back again correctly.
- Simplify scheme testing for relative URLs, we only need to know about supported schemes.
@coveralls
Copy link

coveralls commented Mar 29, 2022

Pull Request Test Coverage Report for Build 2074302900

  • 33 of 36 (91.67%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 96.606%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/nitpick/generic.py 8 11 72.73%
Totals Coverage Status
Change from base Build 2074203793: 0.2%
Covered Lines: 2022
Relevant Lines: 2075

💛 - Coveralls

Copy link
Owner

@andreoliwa andreoliwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows as a first-class citizen. 🚀 🙏🏻

@andreoliwa andreoliwa merged commit 6cff555 into andreoliwa:develop Apr 1, 2022
@mjpieters mjpieters deleted the better_file_handling branch April 1, 2022 01:46
@mjpieters
Copy link
Contributor Author

mjpieters commented Apr 1, 2022

On the coveralls coverage issue: you want to use https://coveralls-python.readthedocs.io/en/latest/ and have it manage reporting to coveralls.io.

Do make sure to set COVERALLS_PARALLEL and add a finalisation step as you don't want the status to flip-flop every time a PR is updated. And pass through the relevant env vars to tox; the coveralls-python docs cover this too.

This way you'd run this all directly from Python and not from a separate docker container, and so works on Mac and Windows too.

github-actions bot pushed a commit that referenced this pull request Mar 27, 2023
# [0.33.0](v0.32.0...v0.33.0) (2023-03-27)

### Bug Fixes

* actually show chosen styles in log output ([#477](#477)) ([9a685ac](9a685ac))
* **deps:** update dependency attrs to v22 ([d3ad0e0](d3ad0e0))
* **deps:** update dependency click to v8.1.3 ([bd54df5](bd54df5))
* **deps:** update dependency configupdater to v3.1.1 ([024fd16](024fd16))
* **deps:** update dependency dpath to v2.1.5 ([#557](#557)) ([6a4fddd](6a4fddd))
* **deps:** update dependency flake8 to v5 ([#559](#559)) ([1bc7b06](1bc7b06))
* **deps:** update dependency freezegun to v1.2.2 ([#543](#543)) ([9a67f5a](9a67f5a))
* **deps:** update dependency identify to v2.5.22 ([00dbdce](00dbdce))
* **deps:** update dependency importlib-resources to v5.12.0 ([68aae5c](68aae5c))
* **deps:** update dependency jmespath to v1 ([e51c957](e51c957))
* **deps:** update dependency marshmallow to v3.19.0 ([a314480](a314480))
* **deps:** update dependency marshmallow-polyfield to v5.11 ([#545](#545)) ([b05092b](b05092b))
* **deps:** update dependency more-itertools to v8.14.0 ([#531](#531)) ([139ef6b](139ef6b))
* **deps:** update dependency pytest to v7 ([a080454](a080454))
* **deps:** update dependency pytest-cov to v4 ([db278d4](db278d4))
* **deps:** update dependency pytest-datadir to v1.4.1 ([c6d5cb4](c6d5cb4))
* **deps:** update dependency pytest-socket to v0.6.0 ([#534](#534)) ([2bdf0d6](2bdf0d6))
* **deps:** update dependency pytest-testmon to v1.4.5 ([392fce5](392fce5))
* **deps:** update dependency pytest-testmon to v2.0.1 ([81b300d](81b300d))
* **deps:** update dependency pytest-testmon to v2.0.2 ([1e58ff2](1e58ff2))
* **deps:** update dependency python-slugify to v8 ([77649bd](77649bd))
* **deps:** update dependency requests to v2.28.2 ([#536](#536)) ([0af1b14](0af1b14))
* **deps:** update dependency requests-cache to v0.9.8 ([#518](#518)) ([2135344](2135344))
* **deps:** update dependency requests-cache to v1.0.1 ([2104255](2104255))
* **deps:** update dependency responses to v0.23.1 ([#537](#537)) ([796034c](796034c))
* **deps:** update dependency sphinx to v4.5.0 ([#538](#538)) ([aee2267](aee2267))
* **deps:** update dependency sphinx to v5 ([#560](#560)) ([b7fcb67](b7fcb67))
* **deps:** update dependency sphinx_rtd_theme to v1.2.0 ([f729818](f729818))
* **deps:** update dependency sphobjinv to v2.3.1 ([33bea38](33bea38))
* **deps:** update dependency strenum to v0.4.10 ([4aed308](4aed308))
* **deps:** update dependency testfixtures to v6.18.5 ([311a5ca](311a5ca))
* **deps:** update dependency tomlkit to v0.11.6 ([a28e6d7](a28e6d7))
* document.add does not work on Linux ([#487](#487)) ([07048bb](07048bb))
* further improve file path handling ([#479](#479)) ([6cff555](6cff555))
* pass in token to fetch GH default branch ([#475](#475)) ([46ea598](46ea598))

### Features

* add MegaLinter plugin ([#476](#476)) ([212a36a](212a36a))
* add Python 3.11 ([2a7cbea](2a7cbea))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants