flake8-use-pathlib


Nameflake8-use-pathlib JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://gitlab.com/RoPP/flake8-use-pathlib
SummaryA plugin for flake8 finding use of functions that can be replaced by pathlib module.
upload_time2022-08-14 08:04:49
maintainer
docs_urlNone
authorRodolphe Pelloux-Prayer
requires_python>=3.7
licenseMIT
keywords flake8 linter pathlib
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # flake8-use-pathlib

[![pypi][pypi-badge]](https://pypi.org/project/flake8-use-pathlib/)
[![black][black-badge]](https://github.com/psf/black)

A plugin for flake8 finding use of functions that can be replaced by pathlib module.

[pypi-badge]: https://badgen.net/pypi/v/flake8-use-pathlib
[black-badge]: https://badgen.net/badge/code%20style/black/black/

## Installation

Install from `pip` with:

`pip install flake8-use-pathlib`

## Rules

| Code  | Rule                                                                                         |
| ----- | -------------------------------------------------------------------------------------------- |
| PL100 | os.path.abspath("foo") should be replaced by foo_path.resolve()                              |
| PL101 | os.chmod("foo", 0o444) should be replaced by foo_path.chmod(0o444)                           |
| PL102 | os.mkdir("foo") should be replaced by foo_path.mkdir()                                       |
| PL103 | os.makedirs("foo/bar") should be replaced by bar_path.mkdir(parents=True)                    |
| PL104 | os.rename("foo", "bar") should be replaced by foo_path.rename(Path("bar"))                   |
| PL105 | os.replace("foo", "bar") should be replaced by foo_path.replace(Path("bar"))                 |
| PL106 | os.rmdir("foo") should be replaced by foo_path.rmdir()                                       |
| PL107 | os.remove("foo") should be replaced by foo_path.unlink()                                     |
| PL108 | os.unlink("foo") should be replaced by foo_path.unlink()                                     |
| PL109 | os.getcwd() should be replaced by Path.cwd()                                                 |
| PL110 | os.path.exists("foo") should be replaced by foo_path.exists()                                |
| PL111 | os.path.expanduser("~/foo") should be replaced by foo_path.expanduser()                      |
| PL112 | os.path.isdir("foo") should be replaced by foo_path.is_dir()                                 |
| PL113 | os.path.isfile("foo") should be replaced by foo_path.is_file()                               |
| PL114 | os.path.islink("foo") should be replaced by foo_path.is_symlink()                            |
| PL115 | os.readlink("foo") should be replaced by foo_path.readlink()                                 |
| PL116 | os.stat("foo") should be replaced by foo_path.stat() or foo_path.owner() or foo_path.group() |
| PL117 | os.path.isabs should be replaced by foo_path.is_absolute()                                   |
| PL118 | os.path.join("foo", "bar") should be replaced by foo_path / "bar"                            |
| PL119 | os.path.basename("foo/bar") should be replaced by bar_path.name                              |
| PL120 | os.path.dirname("foo/bar") should be replaced by bar_path.parent                             |
| PL121 | os.path.samefile("foo", "bar") should be replaced by foo_path.samefile(bar_path)             |
| PL122 | os.path.splitext("foo.bar") should be replaced by foo_path.suffix                            |
| PL123 | open("foo") should be replaced by Path("foo").open()                                         |
| PL124 | py.path.local is in maintenance mode, use pathlib instead                                    |

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/RoPP/flake8-use-pathlib",
    "name": "flake8-use-pathlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "flake8,linter,pathlib",
    "author": "Rodolphe Pelloux-Prayer",
    "author_email": "rodolphe@damsy.net",
    "download_url": "https://files.pythonhosted.org/packages/f9/04/b604a94ea45c9bb3de2145c2f9b8471485e603a45fa54ddbe50289e7079a/flake8-use-pathlib-0.3.0.tar.gz",
    "platform": null,
    "description": "# flake8-use-pathlib\n\n[![pypi][pypi-badge]](https://pypi.org/project/flake8-use-pathlib/)\n[![black][black-badge]](https://github.com/psf/black)\n\nA plugin for flake8 finding use of functions that can be replaced by pathlib module.\n\n[pypi-badge]: https://badgen.net/pypi/v/flake8-use-pathlib\n[black-badge]: https://badgen.net/badge/code%20style/black/black/\n\n## Installation\n\nInstall from `pip` with:\n\n`pip install flake8-use-pathlib`\n\n## Rules\n\n| Code  | Rule                                                                                         |\n| ----- | -------------------------------------------------------------------------------------------- |\n| PL100 | os.path.abspath(\"foo\") should be replaced by foo_path.resolve()                              |\n| PL101 | os.chmod(\"foo\", 0o444) should be replaced by foo_path.chmod(0o444)                           |\n| PL102 | os.mkdir(\"foo\") should be replaced by foo_path.mkdir()                                       |\n| PL103 | os.makedirs(\"foo/bar\") should be replaced by bar_path.mkdir(parents=True)                    |\n| PL104 | os.rename(\"foo\", \"bar\") should be replaced by foo_path.rename(Path(\"bar\"))                   |\n| PL105 | os.replace(\"foo\", \"bar\") should be replaced by foo_path.replace(Path(\"bar\"))                 |\n| PL106 | os.rmdir(\"foo\") should be replaced by foo_path.rmdir()                                       |\n| PL107 | os.remove(\"foo\") should be replaced by foo_path.unlink()                                     |\n| PL108 | os.unlink(\"foo\") should be replaced by foo_path.unlink()                                     |\n| PL109 | os.getcwd() should be replaced by Path.cwd()                                                 |\n| PL110 | os.path.exists(\"foo\") should be replaced by foo_path.exists()                                |\n| PL111 | os.path.expanduser(\"~/foo\") should be replaced by foo_path.expanduser()                      |\n| PL112 | os.path.isdir(\"foo\") should be replaced by foo_path.is_dir()                                 |\n| PL113 | os.path.isfile(\"foo\") should be replaced by foo_path.is_file()                               |\n| PL114 | os.path.islink(\"foo\") should be replaced by foo_path.is_symlink()                            |\n| PL115 | os.readlink(\"foo\") should be replaced by foo_path.readlink()                                 |\n| PL116 | os.stat(\"foo\") should be replaced by foo_path.stat() or foo_path.owner() or foo_path.group() |\n| PL117 | os.path.isabs should be replaced by foo_path.is_absolute()                                   |\n| PL118 | os.path.join(\"foo\", \"bar\") should be replaced by foo_path / \"bar\"                            |\n| PL119 | os.path.basename(\"foo/bar\") should be replaced by bar_path.name                              |\n| PL120 | os.path.dirname(\"foo/bar\") should be replaced by bar_path.parent                             |\n| PL121 | os.path.samefile(\"foo\", \"bar\") should be replaced by foo_path.samefile(bar_path)             |\n| PL122 | os.path.splitext(\"foo.bar\") should be replaced by foo_path.suffix                            |\n| PL123 | open(\"foo\") should be replaced by Path(\"foo\").open()                                         |\n| PL124 | py.path.local is in maintenance mode, use pathlib instead                                    |\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A plugin for flake8 finding use of functions that can be replaced by pathlib module.",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://gitlab.com/RoPP/flake8-use-pathlib",
        "Repository": "https://gitlab.com/RoPP/flake8-use-pathlib"
    },
    "split_keywords": [
        "flake8",
        "linter",
        "pathlib"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "26cdab73ddffbef1574af664dc638453f1138f7f7ba972e06c271dc120f7d65a",
                "md5": "10c6f6bda7eb01da9d27898beb78fd6f",
                "sha256": "c7b6d71575b575f7d70ebf3f1d7f2dd6685e401d3280208f1db9dbb6bfa32608"
            },
            "downloads": -1,
            "filename": "flake8_use_pathlib-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "10c6f6bda7eb01da9d27898beb78fd6f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4861,
            "upload_time": "2022-08-14T08:04:50",
            "upload_time_iso_8601": "2022-08-14T08:04:50.534260Z",
            "url": "https://files.pythonhosted.org/packages/26/cd/ab73ddffbef1574af664dc638453f1138f7f7ba972e06c271dc120f7d65a/flake8_use_pathlib-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f904b604a94ea45c9bb3de2145c2f9b8471485e603a45fa54ddbe50289e7079a",
                "md5": "14a46340be20f7e3df634ee717418f63",
                "sha256": "0ef19f255a51601bcf04ff54f25ef8a466dff68210cd95b4f1db36a78ace5223"
            },
            "downloads": -1,
            "filename": "flake8-use-pathlib-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "14a46340be20f7e3df634ee717418f63",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4316,
            "upload_time": "2022-08-14T08:04:49",
            "upload_time_iso_8601": "2022-08-14T08:04:49.440249Z",
            "url": "https://files.pythonhosted.org/packages/f9/04/b604a94ea45c9bb3de2145c2f9b8471485e603a45fa54ddbe50289e7079a/flake8-use-pathlib-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-08-14 08:04:49",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "RoPP",
    "gitlab_project": "flake8-use-pathlib",
    "lcname": "flake8-use-pathlib"
}
        
Elapsed time: 0.10196s