Skip to content

Instantly share code, notes, and snippets.

View koddsson's full-sized avatar
:fishsticks:

Kristján Oddsson koddsson

:fishsticks:
View GitHub Profile
@koddsson
koddsson / blog.md
Last active September 11, 2018 09:02

Lint checker comments on GitHub PR using Travis

I really like PEP8. It's a standard that's used pretty much everywhere in the python "world". It's job is to make sure that your code adheres to certain rules, for example no line of code should exceed 80 characters.

Recently I opened up a pull request to add a flake8 check to the snippets-service project at mozilla. Flake8 is a command line tool that "lints" your code against certain standards,

#!/usr/bin/env bash
# fork from https://gist.github.com/jakemhiller/d342ad51505addf78ec628a16fd3280f
changed_files="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
check_run package.json "yarn"
xxx:
# 50-character subject line ^
# 72-character wrapped longer description. This should answer: ^
#
# * Why was this change necessary?
# * How does it address the problem?
# * Are there any side effects?
Related-to: [ISSUE]
@koddsson
koddsson / esnextbin.md
Created April 4, 2017 11:09
esnextbin sketch
@koddsson
koddsson / esnextbin.md
Created April 3, 2017 10:14
esnextbin sketch
@koddsson
koddsson / esnextbin.md
Created March 14, 2017 21:45
esnextbin sketch

Keybase proof

I hereby claim:

  • I am koddsson on github.
  • I am koddsson (https://keybase.io/koddsson) on keybase.
  • I have a public key whose fingerprint is CE3A 6AB4 9EAF 00C2 2AB7 4E90 92A0 22F6 0F83 CFC2

To claim this, I am signing this object:

#!/bin/sh
git stash save -k "KODDSSON-PRE-COMMIT-STASH"
npm run lint
git stash apply stash^{/KODDSSON-PRE-COMMIT-STASH}
@koddsson
koddsson / esnextbin.md
Created December 14, 2016 13:21
esnextbin sketch
# If applied, this commit will...
# Explain why this change is being made
# Provide links to any relevant tickets, articles or other resources