Skip to content

Instantly share code, notes, and snippets.

@lightdiscord
Last active January 12, 2021 12:27
Show Gist options
  • Select an option

  • Save lightdiscord/699d09c5362f9dbfb85a4dda30d8d61c to your computer and use it in GitHub Desktop.

Select an option

Save lightdiscord/699d09c5362f9dbfb85a4dda30d8d61c to your computer and use it in GitHub Desktop.
Aggregate norminette results to have the filename in the same line as the message.
#!/usr/bin/env bash
LAST_FILE=""
norminette "$@" | while read -r line
do
if [[ "$line" =~ "Norme: " ]]
then
LAST_FILE="${line:7}"
else
printf '%s: %s\n' "$LAST_FILE" "$line"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment