Comments (4)
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.
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.
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.
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)
- Crash when using regular expressions HOT 2
- Feature suggestion: Ignore only given set of rules HOT 2
- Feature suggestion: Run on files given from terminal, not on files specified in configuration file HOT 7
- Feature suggestion: Path for configuration file given from terminal HOT 2
- astpath recent upgrade breaks `bellybutton lint` HOT 4
- pyyaml update breaks bellybuton lint HOT 2
- Bellybutton breaks on non-ascii characters in source
- --modified-only flag walks over all file types in diff HOT 2
- How To Design a Rule For This Scenario
- Programmatically usage
- Support for Python 3.7+ HOT 1
- Multi-line rules HOT 2
- Support multiple config files (from cli)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bellybutton.