Commit Graph
1741 Commits
Author SHA1 Message Date
A_D 14295ce9e8 Fixed scope whitespace and long lines 2020-07-26 23:08:47 +01:00
A_D 8b0f3e74cf Replaced format directives with fstrings 2020-07-26 23:08:47 +01:00
A_D c6d8b4eab8 Renamed variable for clarity 2020-07-26 23:08:47 +01:00
A_D 0e000de90a Replaced type annotation with Optional
The return is Optional so the annotation on the other side must be as
well, lest we have large red squiggles
2020-07-26 23:08:47 +01:00
A_D 3dfca91e1d Fixed invalid deep_get call 2020-07-26 23:08:47 +01:00
A_D b6482878f0 Fix deep_get not returning the correct on success
I forgot to actually return the given data if we manage to index to the
requested depth
2020-07-26 23:08:47 +01:00
A_D 2403ed1d2f Replaced missed .get chains with deep_get 2020-07-26 23:08:47 +01:00
A_D 4ee8869426 Revert part of e510b783
Apparently config.get does _not_ take a default param. It really should.
2020-07-26 23:08:47 +01:00
A_D 664605a315 Cleaned up ifs where possible
Removed redundant or unneeded parens, correctly added line breaks where
needed
2020-07-26 23:08:47 +01:00
A_D 1ed9225c44 Added main guard
Modules should _always_ check that they are main before doing any "real"
work
2020-07-26 23:08:47 +01:00
A_D 637f58bb06 Replaced modulo-formatting with .format 2020-07-26 23:08:47 +01:00
A_D 0dfad42de3 Replaced .get chains with a new method
`deep_get` will go down a list of keys on a dict to find either the
requested key or the default if somewhere along the line the given dict
doesn't have a given key
2020-07-26 23:08:47 +01:00
A_D 8117e18963 Don't recompile regexps where possible
While the python re lib _does_ cache compiled regexps, it only does this
to a point, it's better to compile once and hold a reference
2020-07-26 23:08:47 +01:00
A_D 37c01c028c Replaced list comprehension with generator
Creating a list here doesnt make sense when its almost instantly
recreated.
2020-07-26 23:08:47 +01:00
A_D 31c049deda Replace sys.stderr.write call with print
`print()` supports files other than stdout, and will automatically add
newlines for us, among other things
2020-07-26 23:08:47 +01:00
A_D f9b860fd5c removed bare except clause 2020-07-26 23:08:47 +01:00
A_D 9d727aaa99 Remove unused variables in as e clauses 2020-07-26 23:08:47 +01:00
A_D 2592af8c9f block flake8 line length on doc line 2020-07-26 23:08:47 +01:00
A_D 2e21960568 add newlines on scope changes 2020-07-26 23:08:47 +01:00
A_D 1f1e34d722 ensure that comments have two spaces before
most of the files have tabs between code and comments
2020-07-26 23:08:47 +01:00
A_D c6e61cc3da Fix ~ not being expanded on linux 2020-07-26 23:08:47 +01:00
A_D d67dd17367 ignore editor and virtual enviroment directories
Just to ensure that they're not reported by any local tools
2020-07-26 23:08:47 +01:00
A_D 179e06d6e9 added informational comment on private access 2020-07-26 23:08:47 +01:00
A_D ecfed2b558 Modified dict comprehension to be more clear 2020-07-26 23:08:47 +01:00
A_D d9658f2cf9 Fixed alignment and comment grammar 2020-07-26 23:08:47 +01:00
A_D 9a482cb04b Added type annotations where needed
Not everywhere because they can be inferred in a lot of places. But I
added them to a lot of the self.* variables
2020-07-26 23:08:47 +01:00
A_D 21ab456e22 Added variables for repeatedly indexed keys
Repeatedly indexing keys is in general slow. And, not only is it slow,
it makes reading code hell.
2020-07-26 23:08:47 +01:00
A_D 12fdbd0678 Replaced x in list with x in tuple
Tuples are immutable, so this ensures that there isn't any funny business
at runtime
2020-07-26 23:08:47 +01:00
A_D 85c27e4cd7 Replaced or-based ternaries with standard ones 2020-07-26 23:08:47 +01:00
A_D 40aa4f9e63 Added whitespace on scope changes 2020-07-26 23:08:47 +01:00
A_D a6d6599c3b Moved logfile regexp to class level constant
Regular expressions are expensive to recompile constantly, and while the
python regexp library currently caches reuse, it only does so to a point
and that is not a required behaviour.

Compiling regexps once is simply best practice. On top of this, the
regexp was duplicated in various places.
2020-07-26 23:08:47 +01:00
A_D b010b8015d Aligned values of large dicts
helps your eyes track the changes
2020-07-26 23:08:47 +01:00
A_D ed45d59af1 Replaced modulo formatters with .format formatters 2020-07-26 23:08:47 +01:00
A_D 05e6d49880 replaced list comp with generator where possible 2020-07-26 23:08:47 +01:00
A_D 33f25da270 Fixed ambiguous names and logic 2020-07-26 23:08:47 +01:00
A_D 1963140572 removed star import 2020-07-26 23:08:47 +01:00
A_D f95bfd4280 removed bare except clauses 2020-07-26 23:08:47 +01:00
A_D bf74e3647f Fixed various whitespace issues 2020-07-26 23:08:47 +01:00
A_D aeb328b31f Removed oneliners 2020-07-26 23:08:47 +01:00
A_D d877de2758 Ensured all lines are under 120 characters wide 2020-07-26 23:08:47 +01:00
A_D 86dea84e94 Removed tabs preceeding inline comments 2020-07-26 23:08:47 +01:00
A_D a40cebc749 Added whitespace around scope changes
Helps with reading code later
2020-07-26 23:08:47 +01:00
A_D ce7c6d4333 removed unused variable 2020-07-26 23:08:47 +01:00
A_D a9f4f5d507 made all regexps raw strings
ensures no weirdness from escapes
2020-07-26 23:08:47 +01:00
A_D ba67db3f13 removed unused imports 2020-07-26 23:08:47 +01:00
Athanasius 6ba1f77352 Remove greet-everyone workflow, we've gotten things working now 2020-07-26 23:04:37 +01:00
Athanasius df3f70b7ed Rename to push-checks.yml, don't do PRs
Also commented better at the top
2020-07-26 23:03:23 +01:00
Athanasius 6513db3aca Don't force --show-source in .flake8 !
This was the cause of our flake8-your-pr issue!  It meant that as well
as `--format json` giving JSON output it also got polluted with the raw
string of the source line as well.
2020-07-26 23:03:23 +01:00
Athanasius d65176aed8 Add flake8-json to requirements-dev.txt 2020-07-26 23:03:23 +01:00
Athanasius 8dbb275dca Specify GITHUB_TOKEN for flake8-your-pr via env 2020-07-26 23:03:23 +01:00