Coder Social home page Coder Social logo

Comments (4)

OddBloke avatar OddBloke commented on May 18, 2024

I'm seeing a related issue: bellybutton recurses into my .tox directory, despite it being excluded by the default generated configuration (I added a print statement to determine that the problem file is .tox/pylint/lib/python3.8/site-packages/pylint/test/functional/implicit_str_concat_in_sequence_latin1.py):

$ bellybutton lint
Traceback (most recent call last):
  File "/home/daniel/.virtualenvs/cloud-init/bin/bellybutton", line 8, in <module>
    sys.exit(main())
  File "/home/daniel/.virtualenvs/cloud-init/lib/python3.8/site-packages/bellybutton/cli.py", line 221, in main
    exit_code = args.func(**{
  File "/home/daniel/.virtualenvs/cloud-init/lib/python3.8/site-packages/bellybutton/cli.py", line 196, in lint
    for failure in linting_failures(filepaths, rules):
  File "/home/daniel/.virtualenvs/cloud-init/lib/python3.8/site-packages/bellybutton/cli.py", line 139, in linting_failures
    for filepath, file_contents in files:
  File "/home/daniel/.virtualenvs/cloud-init/lib/python3.8/site-packages/bellybutton/cli.py", line 110, in open_python_files
    contents = f.read()
  File "/usr/lib/python3.8/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 96: invalid continuation byte

from bellybutton.

rubenhelsloot avatar rubenhelsloot commented on May 18, 2024

I'm having the same problem. I have a .venv folder in my directory with symlinks to python files, but from the source code, it seems bellybutton lint doesn't exclude anything. Instead, it gives

Traceback (most recent call last):
  File "/Users/rubenhelsloot/.pyenv/versions/3.8.6/envs/crunchr/bin/bellybutton", line 33, in <module>
    sys.exit(load_entry_point('bellybutton==0.3.1', 'console_scripts', 'bellybutton')())
  File "/Users/rubenhelsloot/.pyenv/versions/3.8.6/envs/crunchr/lib/python3.8/site-packages/bellybutton/cli.py", line 217, in main
    exit_code = args.func(**{
  File "/Users/rubenhelsloot/.pyenv/versions/3.8.6/envs/crunchr/lib/python3.8/site-packages/bellybutton/cli.py", line 192, in lint
    for failure in linting_failures(filepaths, rules):
  File "/Users/rubenhelsloot/.pyenv/versions/3.8.6/envs/crunchr/lib/python3.8/site-packages/bellybutton/cli.py", line 135, in linting_failures
    for filepath, file_contents in files:
  File "/Users/rubenhelsloot/.pyenv/versions/3.8.6/envs/crunchr/lib/python3.8/site-packages/bellybutton/cli.py", line 108, in open_python_files
    with open(filepath, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/rubenhelsloot/crunchr/.venv/lib/python3.8/_bootlocale.py'

from bellybutton.

boomshadow avatar boomshadow commented on May 18, 2024

It works fine for me, following the example .bellybutton.yml in this repo. I was able to exclude the venv directory just fine:

settings:
  all_files: !settings &all_files
    included:
      - ~+/*
    excluded:
      - ~+/.tox/*
      - ~+/venv/*
    allow_ignore: yes

from bellybutton.

bhargavrpatel avatar bhargavrpatel commented on May 18, 2024

This doesn't work for me. (sss is my project name)

settings:
  all_files: &all_files !settings
    included:
      - ~+/sss/*
    excluded:
      - ~+/.tox/*
      - ~+/.venv/*
      - ~+/venv/*
    allow_ignore: yes

  tests_only: &tests_only !settings
    included:
      - ~+/tests/*
    excluded:
      - ~+/.tox/*
      - ~+/.venv/*
      - ~+/venv/*
    allow_ignore: yes

  excluding_tests: &excluding_tests !settings
    included:
      - ~+/sss/*
    excluded:
      - ~+/tests/*
      - ~+/.tox/*
      - ~+/venv/*
    allow_ignore: yes

default_settings: *excluding_tests

rules:
  ExampleRule:
    description: "Empty module."
    expr: /Module/body[not(./*)]
    example: ""
    instead: |
      """This module has a docstring."""

from bellybutton.

Related Issues (14)

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.