Skip to main content

Stephen Lints Your Python

Project description

SLYP

PyPI - Version PyPI - Python Version


Table of Contents

Hi

:wave:

I'm Stephen. I'm going to lint your Python code.

Installation

slyp is a python package and can be run as a pre-commit hook.

On supported python versions, it should be installed with

pip install slyp

Usage

Either use it as a CLI tool:

slyp src/

Or as a pre-commit hook using the following pre-commit-config.yaml:

- repo: https://github.com/sirosen/slyp
  rev: 0.0.2
  hooks:
    - id: slyp

Implemented Rules

E100

'unnecessary string concat'

x = "foo " "bar"

E101

'unparenthesized multiline string concat in keyword arg'

foo(
    bar="alpha "
    "beta"
)

E102

'unparenthesized multiline string concat in dict value'

{
    "foo": "alpha "
    "beta"
}

E103

'unparenthesized multiline string concat in collection type'

x = (  # a tuple, set or list
    "alpha "
    "beta",
    "gamma"
)
x = {  # e.g. a set
    "alpha "
    "beta",
}

W200

'two AST branches have identical contents'

if x is True:
    return y + 1
else:
    # some comment
    return y + 1

License

slyp is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slyp-0.0.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

slyp-0.0.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file slyp-0.0.2.tar.gz.

File metadata

  • Download URL: slyp-0.0.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for slyp-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8559eebdca7834b261aeb51d65f3b0188f6e7481006a80f6e3e6d4d99a2bce28
MD5 0fa6a613e1aca3a598848bc64776194a
BLAKE2b-256 7a89605b1b4b0dbd2726bd7d9fb0f3985de5cd4998cc8dbe6d6dd50505d9be6c

See more details on using hashes here.

Provenance

File details

Details for the file slyp-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: slyp-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for slyp-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fcd7539a6cdc23557678bf55cf4ce1389a9f2b57d1f0bbc7f3d2dd093c052a4
MD5 28137a776bf515983588f9a8c36b5a36
BLAKE2b-256 abf190c807da08dccdc65f114f117eb5683b4714333810c6d5f1d0a24d6f3a81

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page