Skip to main content

Print only on failure.

Project description

failprint

Print only on failure.

:warning: Work in progress!

Tired of searching the quiet options of your programs to lighten up the output of your make check or make lint commands?

Tired of finding out that standard output and error are mixed up in some of them?

Simply run your command through failprint. If it succeeds, nothing is printed. If it fails, standard error is printed. Plus other configuration goodies :wink:

Example

Some tools output a lot of things. You don't want to see it when the command succeeds.

Without failprint:

  • poetry run bandit -s B404 -r src/
  • poetry run black --check $(PY_SRC)

basic

With failprint:

  • poetry run failprint -- bandit -s B404 -r src/
  • poetry run failprint -- black --check $(PY_SRC)

failprint_fail

It's already better, no? Much more readable!

And when everything passes, it's even better:

failprint_success

Usage

usage: failprint [-h] [-f {custom,pretty,tap}] [-o {stdout,stderr,combine}] [-n NUMBER] [-t TITLE] COMMAND [COMMAND ...]

positional arguments:
  COMMAND

optional arguments:
  -h, --help            show this help message and exit
  -f {custom,pretty,tap}, --format {custom,pretty,tap}
                        Output format. Pass your own Jinja2 template as a string with '-f custom=TEMPLATE'.
                        Available variables: title (command or title passed with -t), code (exit status), success (boolean), failure (boolean),
                        n (command number passed with -n), output (command output). Available filters: indent (textwrap.indent).
  -o {stdout,stderr,combine}, --output {stdout,stderr,combine}
                        Which output to use. Colors are supported with 'combine' only, unless the command has a 'force color' option.
  -n NUMBER, --number NUMBER
                        Command number. Useful for the 'tap' format.
  -t TITLE, --title TITLE
                        Command title. Default is the command itself.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

failprint-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

failprint-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file failprint-0.1.0.tar.gz.

File metadata

  • Download URL: failprint-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.8.2 Linux/5.6.6-arch1-1

File hashes

Hashes for failprint-0.1.0.tar.gz
Algorithm Hash digest
SHA256 40fd7e7b4d822cd966fcf6b36f634c62d4899a14522db990c27e25d25aa3f2a5
MD5 5004971e76d48d638b86fbcf27951fd6
BLAKE2b-256 37796de2be8eb256c2e7f5801287e31fe4e9db42ee8bb1687e0dd2f5bd4fe51d

See more details on using hashes here.

File details

Details for the file failprint-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: failprint-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.8.2 Linux/5.6.6-arch1-1

File hashes

Hashes for failprint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acdb6538a0066db2023fc4081204da5b84929b63930819e97b5c5eb0d7b817ad
MD5 60f1c4c5a0468a85b8ccbcedcbf5ef9b
BLAKE2b-256 216299e420637d06784395dbd31dbbb80bd4a1efd3e074c9f5b6d9127a1577ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page