Skip to main content

This Flake8 plugin for checking that first param of callable is simple string.

Project description

flake8-simple-string-first-arg

This Flake8 plugin for checking that first param of callable object is simple string. Plugin will check for specified callable objects that it is not allowed to use f-sting, .format method, string concat and % statement for first parameter

Quick Start Guide

  1. Install flake8-simple-string-first-arg from PyPI with pip:

     pip install flake8-simple-string-first-arg
    
  2. Configure a mark that you would like to validate:

     cd project_root/
     vi setup.cfg
    
  3. Add to file following:

     [flake8]  
     simple-string-first-arg = SomeClassName, OtherClassName:url
    
  4. Run flake8::

     flake8 .
    

flake8 codes

  • SFA100: In calling {CallableName} f-string is used
  • SFA200: In calling {CallableName} string.format() is used
  • SFA300: In calling {CallableName} string concatenation ("+") is used
  • SFA400: In calling {CallableName} "%" is used

Settings

simple-string-first-arg
It specifies a list of name of callable objects, that should have simple string as first arg. You can add the name of the argument via : to check if it is passed as a named parameter.

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

flake8_simple_string_first_arg-0.2.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file flake8_simple_string_first_arg-0.2.0.tar.gz.

File metadata

File hashes

Hashes for flake8_simple_string_first_arg-0.2.0.tar.gz
Algorithm Hash digest
SHA256 887baee6a8bd223e6dec60606cbfabfce0840db395f171d62551c72740215103
MD5 ef3f15318da2d915e0164a90c99cef62
BLAKE2b-256 3b34d286cf25ca75c1d2182c36a0c08f58cc8c2568a8e3d1ba1abca6b9f98ccd

See more details on using hashes here.

File details

Details for the file flake8_simple_string_first_arg-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_simple_string_first_arg-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2315e79636dc3ec84c7027934c7ca88595218d642a87686a36a9e363a53041c2
MD5 7df9e70428363724530a6073c7947d53
BLAKE2b-256 45d7c55592ca2b1f265f6b41b3ee656f29cd17e57d60bc21e9d706bead8e65ca

See more details on using hashes here.

Supported by

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