Skip to content

Instantly share code, notes, and snippets.

View ahogen's full-sized avatar

Alex H ahogen

View GitHub Profile
@ahogen
ahogen / pylint-exit-handler.sh
Created November 9, 2018 17:27
Parse and filter PyLint exit codes. Useful for Gitlab CI, Jenkins, or other continuous integration scripting which uses PyLint for Python.
#!/bin/bash
################################################################################
# Alex Hogen (code.ahogen@outlook.com)
# https://github.com/ahogen
#
# A basic script to inspect the return code from pylint, filter it based on our
# needs, and return with a non-zero exit code when appropriate.
#
# PyLint returns non-zero exit codes for things that aren't errors. For example,
# if a warning message was issued, 0x4 is OR'd into the exit code.
#!/bin/bash
#####################################################################
# Alex Hogen (https://github.com/ahogen)
#
# Run the command provided, redirecting STDERR to STDOUT, effectivly
# reducing all output to a single output pipe, hence the name "spipe".
# This script is also capable of capturing some common kill codes
# and forwarding them to the child process.
#
#!/usr/bin/env python3
"""
The idea here is to have one demo of each common argparse format
type. This is useful for me to be able to copy/paste into a new
script and have something to quickly edit and trim down to get
the functionality I need.
Expect this file to grow/change as I need new options.
This is, however, a working example. I hate examples that don't