Skip to main content

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.

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.2.0.tar.gz (4.4 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.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for failprint-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6531c06acf246e5af323086fdae145323cbfe6ff94c8dba98a97b1dc560bc5a5
MD5 4ffe5f6fb29179baa07d874523743a5b
BLAKE2b-256 52f07e5175820f2b2657a94440e2fbf45f431a770fe3484ecf2ac1ddc674d7f3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for failprint-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 796b054fa56c8e54c668564943e1513409ec3bbc8f6b99e64489e60b2642475b
MD5 4b27a4dae9094a9796c9064fc2c522ca
BLAKE2b-256 a5f4be366f8b6497fcfc258455b4a1738bac8816e1317e85d25c22c1447b7798

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.0

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

This release

0.2.0 This release

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page