Comments (7)
@guykisel What format does pre-commit require? There are several output options available already (see http://prospector.readthedocs.org/en/latest/usage.html#output-format). Are any of them useful?
If not, feel free to create a new output formatter which can fix exactly what you need. Examples are here: https://github.com/landscapeio/prospector/tree/master/prospector/formatters
I'm happy to answer any questions :)
from prospector.
There's no particular required format, it normally just displays whatever is written to stdout with no modifications. Your default human-readable format is actually pretty much perfect, I just want to skip the headers because they end up being a little redundant.
Example output (with -M
arg):
13:22 $ pre-commit run prospector --all-files
prospector..................................................................................................................................................................................Failed
hookid: prospector
Messages
========
Messages
========
__init__ (services/platform/base/__init__.py):
L17:4 Base.url: pylint - W0221
Arguments number differs from overridden method
__init__ (services/platform/base/__init__.py):
L17:17 Base.url: pylint - W0613
Unused argument 'secure'
Messages
========
Messages
========
Messages
========
Messages
========
preferences (services/platform/data/preferences.py):
L21:24 Preferences.get_preferences: pylint - W0613
Unused argument 'ship_id'
from prospector.
Looks like I could make my own version of the text.py
formatter that just doesn't include the header. Is it possible to tell prospector to use a 3rd party formatter?
from prospector.
Right now there's no ability to use a third-party formatter, but I don't mind merging in one called "precommit" or whatever you want. Also happy to merge in a change to allow third-party formatters!
Maybe a feature which allows 'output template' strings would be nice, so you could say:
prospector --output-template "%(code)s %(message)s %(linenumber)s"
from prospector.
Cool, that would be nice. I was also thinking, an alternative would be to modify prospector to allow an arbitrary number of positional path arguments, as opposed to being limited to one. I suspect this would require more significant modifications, though.
from prospector.
@guykisel Yes, I think that is the better solution but it requires fiddling with setoptconf a bit so it is perhaps non-trivial. That is something I'd like to do though.
from prospector.
I think once prospector can accept multiple input paths, the pre-commit hook would work great without needing a custom formatter.
Until then, the pylint
formatter provides output that doesn't have a header, so I'll just suggest that users of the hook specify that formatter.
Thank you for your help!
from prospector.
Related Issues (20)
- [BUG]Cannot run tool bandit as support was not installed. HOT 4
- [BUG] Mypy is described as experimental when it's now stable HOT 1
- [BUG] prospector2 won't install on Windows apparently since using forward slash instead of os.path.join HOT 1
- Prospector 1.10.2 does not support `with_mypy` optional tool [in conda] HOT 5
- [BUG] prospector fails when pyproject.toml contain multiple constraints dependencies
- [FEATURE REQUEST] MyPy check-untyped-defs option.
- [BUG] Incorrect additional_dependencies documentation to run prospector as a pre-commit hook with mypy support HOT 2
- [BUG] toml support is incomplete HOT 1
- [PKG SUPPORT] `pylint <3` and Python 3.12 HOT 10
- [PKG SUPPORT] changes for support of `flake >=6.0.0` (and Python 3.12, implicit) HOT 3
- [BUG] pre-commit hook fails on Python 3.12 because of deprecated pkg_resources HOT 3
- [BUG] False positive E231 error in pycodestyle HOT 3
- [BUG] Fatal error pylint: astroid-error HOT 1
- [FEATURE REQUEST] How to use `prospector` on a string
- [BUG] missing dependency: setuptools HOT 1
- [BUG] Crash with ValueError HOT 1
- [BUG] prospector fails with UnicodeDecodeError on requirements.txt having DOS (CRLF) line endings HOT 2
- [BUG] `prospector[with_pyroma]` not appearing to install pyroma when creating conda environments
- [FEATURE REQUEST] Baseline generation
- [BUG] Strange errors with python version 3.12.3
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 prospector.