GithubHelp home page GithubHelp logo

Comments (5)

sjahl avatar sjahl commented on August 20, 2024 2

I was able to resolve this by manually specifying the linter executable with the setting provided in #38, like so:

        "linters":
        {
            "flake8": {
                "executable": "/Users/username/.virtualenvs/myvirtualenv/bin/flake8"
            }
        }

Which I can do on a per-project bases (and works well enough for me). I still believe that there's a bug here -- that we can't rely on the executable at /usr/local/bin/flake8 to actually correspond to the version of python we have defined with @python.

Perhaps an easy solution is to call flake8 with something like python<version> -m flake8 as is recommended (for users with multiple python versions installed) in the Note here: https://flake8.readthedocs.io/en/latest/#using-flake8 ?

from sublimelinter-flake8.

posita avatar posita commented on August 20, 2024

@sjahl wrote:

I was able to resolve this by manually specifying the linter executable with the setting provided in #38, like so:

        "linters":
        {
            "flake8": {
                "executable": "/Users/username/.virtualenvs/myvirtualenv/bin/flake8"
            }
        }

This work-around does not work for me. (See SublimeLinter/SublimeLinter#573.)

Which I can do on a per-project bases (and works well enough for me).

Just curious, but does ${project} expansion work for you? (Meaning, would it work if you were to place the virtual env inside your project directory and then reference flake8 by, e.g., ${project}/.virtualenv/bin/flake8?)

from sublimelinter-flake8.

ptim avatar ptim commented on August 20, 2024

@posita the ${project_path} expansion does work for me from my project-settings, though my flake8 extensions are not picked up...

{
  "SublimeLinter":
  {
    "linters":
    {
      "flake8": {
        "executable": "${project_path}/.direnv/python-3.6.1/bin/flake8",
      }
    }
  }
}

When SublimeLinter debug is true, I see on the console:

SublimeLinter: flake8: 0001_initial.py ['/Users/me/source/project/.direnv/python-3.6.1/bin/flake8', '--max-line-length=120', '--jobs=1', '--max-complexity=-1', '-'] 
SublimeLinter: flake8 output:
stdin:44:121: E501 line too long (176 > 120 characters)

I want this file (and all migrations) to be ignored via flake8-putty settings (which is working from the command line using the same flake8 binary).

from sublimelinter-flake8.

brianbruggeman avatar brianbruggeman commented on August 20, 2024

Putting a comment in here so I can come back to the discussion later.

I very much would like to avoid using the ${project} dir for my virtual environments. That really goes against the ecosystem (i.e. WORKON folder / multiple projects). Seems like there's definitely something missing, though.

from sublimelinter-flake8.

groteworld avatar groteworld commented on August 20, 2024

This type of issue seems to be fixed with SL-flake8 3.0.0. Open if i'm mistaken

from sublimelinter-flake8.

Related Issues (20)

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.