flake8-x-quotes


Nameflake8-x-quotes JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/brodybits/flake8-x-quotes
SummaryFlake8 lint for quotes.
upload_time2023-11-19 10:01:54
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords flake8 lint quotes
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            flake8-x-quotes - fork of flake8-x-quotes with an update for f-strings
======================================================================

..
   TODO: Implement GitHub CI & show badge here

Major update from flake8-quotes 2.0.0
-------------------------------------
We automatically encourage avoiding escaping quotes as per `PEP 8 <https://www.python.org/dev/peps/pep-0008/#string-quotes>`_. To disable this, use ``--no-avoid-escape`` (can be used in configuration file via ``avoid-escape``).

Deprecated option removed from this fork of flake8-quotes
---------------------------------------------------------

- ``--quotes`` - now renamed to ``--inline-quotes``.

Usage
-----

If you are using flake8 it's as easy as:

.. code:: shell

    pip install flake8-x-quotes

Now you don't need to worry about people like @sectioneight constantly
complaining that you are using double-quotes and not single-quotes.

Warnings
--------

This package adds flake8 warnings with the prefix ``Q0``. You might want to
enable this warning inside your flake8 configuration file. Typically that
will be ``.flake8`` inside the root folder of your project.

.. code:: ini

    select = Q0

The current set of warnings is:

==== =========================================================================
Code Description
---- -------------------------------------------------------------------------
Q000 Remove bad quotes
Q001 Remove bad quotes from multiline string
Q002 Remove bad quotes from docstring
Q003 Change outer quotes to avoid escaping inner quotes
Q099 [flake8-x-quotes] Remove bad quotes from f-string - CODE IS SUBJECT TO CHANGE
==== =========================================================================

Configuration
-------------

By default, we expect single quotes (') and look for unwanted double quotes (") (other way around for f-string quotes, multiline quotes, and docstring quotes). To expect double quotes (") and find unwanted single quotes ('), use the CLI option:

.. code:: shell

    flake8 --inline-quotes '"'
    # We also support "double" and "single"
    # flake8 --inline-quotes 'double'
    #
    # We also support configuration for multiline quotes
    # flake8 --inline-quotes '"' --multiline-quotes "'"
    # We also support "'''"
    # flake8 --inline-quotes '"' --multiline-quotes "'''"
    #
    # We also support docstring quotes similarly
    # flake8 --inline-quotes '"' --docstring-quotes "'"
    # flake8 --inline-quotes '"' --docstring-quotes "'''"

    # We also support disabling escaping quotes
    # flake8 --no-avoid-escape

    # [flake8-x-quotes] configure for f-string vs normal string literal:
    flake8 --inline-quotes 'double' --f-string-quotes 'single'

or configuration option in `tox.ini`/`setup.cfg`.

.. code:: ini

    [flake8]
    inline-quotes = "
    # We also support "double" and "single"
    # inline-quotes = double
    #
    # We also support configuration for multiline quotes
    # multiline-quotes = '
    # We also support "'''"
    # multiline-quotes = '''
    #
    # We also support docstring quotes similarly
    # docstring-quotes = '
    # docstring-quotes = '''
    #
    # We also support disabling escaping quotes
    # avoid-escape = False
    #
    # [flake8-x-quotes] configure for f-string vs normal string literal:
    # inline-quotes = double
    # f-string-quotes = single

Supported Python versions
-------------------------

- minimum Python version tested & supported with: 3.8
- known issue with f-string starting with Python 3.12: <https://github.com/zheller/flake8-quotes/issues/117>

Caveats
-------

We follow the `PEP8 conventions <https://www.python.org/dev/peps/pep-0008/#string-quotes>`_ to avoid backslashes in the string. So, no matter what configuration you are using (single or double quotes) these are always valid strings

.. code:: python

    s = 'double "quotes" wrapped in singles are ignored'
    s = "single 'quotes' wrapped in doubles are ignored"

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/brodybits/flake8-x-quotes",
    "name": "flake8-x-quotes",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "flake8 lint quotes",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/8c/7d/a8882bf51e9890cd159cdb064e96776d46bdeeafa450cb74746059d0e440/flake8-x-quotes-0.0.2.tar.gz",
    "platform": null,
    "description": "flake8-x-quotes - fork of flake8-x-quotes with an update for f-strings\n======================================================================\n\n..\n   TODO: Implement GitHub CI & show badge here\n\nMajor update from flake8-quotes 2.0.0\n-------------------------------------\nWe automatically encourage avoiding escaping quotes as per `PEP 8 <https://www.python.org/dev/peps/pep-0008/#string-quotes>`_. To disable this, use ``--no-avoid-escape`` (can be used in configuration file via ``avoid-escape``).\n\nDeprecated option removed from this fork of flake8-quotes\n---------------------------------------------------------\n\n- ``--quotes`` - now renamed to ``--inline-quotes``.\n\nUsage\n-----\n\nIf you are using flake8 it's as easy as:\n\n.. code:: shell\n\n    pip install flake8-x-quotes\n\nNow you don't need to worry about people like @sectioneight constantly\ncomplaining that you are using double-quotes and not single-quotes.\n\nWarnings\n--------\n\nThis package adds flake8 warnings with the prefix ``Q0``. You might want to\nenable this warning inside your flake8 configuration file. Typically that\nwill be ``.flake8`` inside the root folder of your project.\n\n.. code:: ini\n\n    select = Q0\n\nThe current set of warnings is:\n\n==== =========================================================================\nCode Description\n---- -------------------------------------------------------------------------\nQ000 Remove bad quotes\nQ001 Remove bad quotes from multiline string\nQ002 Remove bad quotes from docstring\nQ003 Change outer quotes to avoid escaping inner quotes\nQ099 [flake8-x-quotes] Remove bad quotes from f-string - CODE IS SUBJECT TO CHANGE\n==== =========================================================================\n\nConfiguration\n-------------\n\nBy default, we expect single quotes (') and look for unwanted double quotes (\") (other way around for f-string quotes, multiline quotes, and docstring quotes). To expect double quotes (\") and find unwanted single quotes ('), use the CLI option:\n\n.. code:: shell\n\n    flake8 --inline-quotes '\"'\n    # We also support \"double\" and \"single\"\n    # flake8 --inline-quotes 'double'\n    #\n    # We also support configuration for multiline quotes\n    # flake8 --inline-quotes '\"' --multiline-quotes \"'\"\n    # We also support \"'''\"\n    # flake8 --inline-quotes '\"' --multiline-quotes \"'''\"\n    #\n    # We also support docstring quotes similarly\n    # flake8 --inline-quotes '\"' --docstring-quotes \"'\"\n    # flake8 --inline-quotes '\"' --docstring-quotes \"'''\"\n\n    # We also support disabling escaping quotes\n    # flake8 --no-avoid-escape\n\n    # [flake8-x-quotes] configure for f-string vs normal string literal:\n    flake8 --inline-quotes 'double' --f-string-quotes 'single'\n\nor configuration option in `tox.ini`/`setup.cfg`.\n\n.. code:: ini\n\n    [flake8]\n    inline-quotes = \"\n    # We also support \"double\" and \"single\"\n    # inline-quotes = double\n    #\n    # We also support configuration for multiline quotes\n    # multiline-quotes = '\n    # We also support \"'''\"\n    # multiline-quotes = '''\n    #\n    # We also support docstring quotes similarly\n    # docstring-quotes = '\n    # docstring-quotes = '''\n    #\n    # We also support disabling escaping quotes\n    # avoid-escape = False\n    #\n    # [flake8-x-quotes] configure for f-string vs normal string literal:\n    # inline-quotes = double\n    # f-string-quotes = single\n\nSupported Python versions\n-------------------------\n\n- minimum Python version tested & supported with: 3.8\n- known issue with f-string starting with Python 3.12: <https://github.com/zheller/flake8-quotes/issues/117>\n\nCaveats\n-------\n\nWe follow the `PEP8 conventions <https://www.python.org/dev/peps/pep-0008/#string-quotes>`_ to avoid backslashes in the string. So, no matter what configuration you are using (single or double quotes) these are always valid strings\n\n.. code:: python\n\n    s = 'double \"quotes\" wrapped in singles are ignored'\n    s = \"single 'quotes' wrapped in doubles are ignored\"\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Flake8 lint for quotes.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/brodybits/flake8-x-quotes"
    },
    "split_keywords": [
        "flake8",
        "lint",
        "quotes"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c7da8882bf51e9890cd159cdb064e96776d46bdeeafa450cb74746059d0e440",
                "md5": "51ef5b0667aa49c8331f314483ff5628",
                "sha256": "a684b277978063f902403e07d961efb0e3eae73532215c561a00c8c4b13a9d84"
            },
            "downloads": -1,
            "filename": "flake8-x-quotes-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "51ef5b0667aa49c8331f314483ff5628",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13927,
            "upload_time": "2023-11-19T10:01:54",
            "upload_time_iso_8601": "2023-11-19T10:01:54.001538Z",
            "url": "https://files.pythonhosted.org/packages/8c/7d/a8882bf51e9890cd159cdb064e96776d46bdeeafa450cb74746059d0e440/flake8-x-quotes-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-19 10:01:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "brodybits",
    "github_project": "flake8-x-quotes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flake8-x-quotes"
}
        
Elapsed time: 0.15110s