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 hashes)

Uploaded Source

Built Distribution

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