Coder Social home page Coder Social logo

vscode-cornflakes-linter's Introduction

Readme

"cornflakes-linter" is a wrapper for flake8.

** added onType linting (0.5) **

vscode currently already has flake8 integration HOWEVER it doesn't play nicely with flake8 plugins in that the regex can't parse the output correctly. This means that the errors/warnings/information do not show up in the problems tab. This extension rectifies that.

Quick Start.

  1. Make sure you have installed flake8 somewhere..
  2. Set the path to the flake8 in Settings.json (or search in the vscode settings tab).
{
	"cornflakes.linter.executablePath": "path/to/venvs/myvenv/bin/flake8"
}
  1. Open a .py file and then save it and the extension will run showing all of the lint issues in the problems tab.

Configuration

For the extension

You need to include the full path to the flake8 executable that you wish to use.

To find the path to the appropriate flake8 you can (on *nix) do. I'm sure you can do something similar on Windows too.

which flake8

The set it in Settings.json

{
	"cornflakes.linter.executablePath": "path/to/venvs/myvenv/bin/flake8"
}

Change when the linter is run

There are a couple of options here so that you can decide when to re-lint the current file. You can choose either on save or on type! Again all settings are available through the settings page, or the json.

{
	"cornflakes.linter.run": "onType"
}

Flake8 configuration

The way to configure flake8 extensions / settings / ignores and all other configuration for flake8 is by using the standard flake8 configuration rules. The extension will be run from the root directory of the workspace.

Personally I like a tox.ini in the workspace root.

[flake8]
ignore = E226,E302,E41
max-line-length = 88
exclude = tests/*
max-complexity = 10

Acknowledgements

And is virtually a direct copy of ruby-linter.

The extension architecture is based off of the PHPValidationProvider from the built-in php extension.

Attributions

Icons made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY

vscode-cornflakes-linter's People

Contributors

elidhu avatar kevindotglasson avatar

Watchers

James Cloos 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.