GithubHelp home page GithubHelp logo

flake8-coding's Introduction

Flake8 Coding plugin

https://travis-ci.org/tk0miya/flake8-coding.svg?branch=master https://coveralls.io/repos/tk0miya/flake8-coding/badge.png?branch=master Code Climate

Adds coding magic comment checks (coding:) to flake8.

Install

Install with pip:

$ pip install flake8-coding

You can check that flake8 has picked it up by looking for flake8_coding in the output of --version:

$ flake8 --version
2.5.4 (pep8: 1.7.0, pyflakes: 1.0.0, flake8_coding: 1.1.1, mccabe: 0.4.0) CPython 2.7.11 on Darwin

Options

accept-encodings

A comma-separated list of acceptable source code encodings for the coding: magic comments in files. Default is latin-1, utf-8.

You can pass this as a command-line argument to flake8, e.g. --accept-encodings=utf-8,utf-16, or put it in your config file, e.g.:

[flake8]
accept-encodings = utf-8,utf-16

no-accept-encodings

If activated, this disallows all coding: magic comments, no matter their encoding. This might be useful for Python 3 projects where UTF-8 is the default and you don't want other encodings used in your project.

You can pass this as a command-line argument to flake8, e.g. --no-accept-encodings, or put it in your config file, e.g.:

[flake8]
no-accept-encodings

Rules

C101 Coding magic comment not found

No magic encoding comment was found in the file. As per PEP-263, this must be in the first two lines of the file.

C102 Unknown encoding found in coding magic comment

The encoding found in the magic encoding comment did not match the accept-encodings option.

C103 Coding magic comment present

no-accept-encodings is set, and a magic encoding comment was found in the file.

Requirements

  • Python 2.6, 2.7, 3.3, 3.4
  • flake8

License

Apache License 2.0

flake8-coding's People

Contributors

tk0miya avatar jdufresne avatar adamchainz avatar gforcada avatar

Watchers

Hans Lawrenz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.