-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from ducted/feature/add-linting
Feature/add linting
- Loading branch information
Showing
58 changed files
with
1,799 additions
and
1,125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
[MASTER] | ||
rcfile=./.pylintrc | ||
ignore=CVS | ||
ignore-patterns=.*_pb2.py,test_.*.py | ||
persistent=no | ||
load-plugins= | ||
jobs=2 | ||
unsafe-load-any-extension=no | ||
extension-pkg-whitelist= | ||
optimize-ast=no | ||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} | ||
|
||
[MESSAGES CONTROL] | ||
|
||
# Only show warnings with the listed confidence levels. Leave empty to show | ||
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED | ||
confidence= | ||
|
||
disable=R,import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,too-few-public-methods,invalid-name,broad-except,abstract-method,bare-except,eval-used,no-init,redefined-outer-name,dangerous-default-value | ||
|
||
|
||
[REPORTS] | ||
output-format=colorized | ||
files-output=no | ||
reports=yes | ||
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) | ||
|
||
[TYPECHECK] | ||
ignore-mixin-members=yes | ||
ignored-modules=twisted.internet.reactor,zope.interface | ||
ignored-classes=optparse.Values,thread._local,_thread._local | ||
# List of members which are set dynamically and missed by pylint inference | ||
# system, and so shouldn't trigger E1101 when accessed. Python regular | ||
# expressions are accepted. | ||
generated-members= | ||
|
||
contextmanager-decorators=contextlib.contextmanager | ||
|
||
[LOGGING] | ||
logging-modules=logging | ||
|
||
[FORMAT] | ||
max-line-length=80 | ||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$ | ||
single-line-if-stmt=no | ||
no-space-check=trailing-comma,dict-separator | ||
max-module-lines=1000 | ||
indent-string=' ' | ||
indent-after-paren=4 | ||
expected-line-ending-format= | ||
|
||
[SPELLING] | ||
spelling-dict= | ||
spelling-ignore-words= | ||
spelling-private-dict-file= | ||
spelling-store-unknown-words=no | ||
|
||
[MISCELLANEOUS] | ||
notes=FIXME,XXX,TODO | ||
|
||
[SIMILARITIES] | ||
min-similarity-lines=4 | ||
ignore-comments=yes | ||
ignore-docstrings=yes | ||
ignore-imports=no | ||
|
||
[BASIC] | ||
good-names=i,j,k,ex,Run,_ | ||
bad-names=foo,bar,baz,toto,tutu,tata | ||
name-group= | ||
include-naming-hint=no | ||
property-classes=abc.abstractproperty | ||
docstring-min-length=-1 | ||
|
||
function-rgx=_?_?[A-Za-z_][A-Za-z0-9_]{1,30}$ | ||
method-rgx=_?_?[a-z_][A-Za-z0-9_]{1,30}$ | ||
argument-rgx=_?[a-z_][A-Za-z0-9_]{1,30}$ | ||
variable-rgx=_?[a-z_][A-Za-z0-9_]{1,30}$ | ||
inlinevar-rgx=_?[a-z_][A-Za-z0-9_]{1,30}$ | ||
attr-rgx=_?[a-z_][A-Za-z0-9_]{1,30}$ | ||
|
||
[ELIF] | ||
max-nested-blocks=5 | ||
|
||
|
||
[VARIABLES] | ||
init-import=no | ||
dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy | ||
additional-builtins= | ||
callbacks=cb_,_cb | ||
redefining-builtins-modules=six.moves,future.builtins | ||
|
||
[IMPORTS] | ||
deprecated-modules=regsub,TERMIOS,Bastion,rexec | ||
import-graph= | ||
ext-import-graph= | ||
int-import-graph= | ||
known-standard-library= | ||
known-third-party=enchant | ||
analyse-fallback-blocks=no | ||
|
||
[CLASSES] | ||
|
||
defining-attr-methods=__init__,__new__,setUp | ||
valid-classmethod-first-arg=cls | ||
valid-metaclass-classmethod-first-arg=mcs | ||
exclude-protected=_asdict,_fields,_replace,_source,_make | ||
|
||
[DESIGN] | ||
max-args=15 | ||
ignored-argument-names=_.* | ||
max-locals=15 | ||
max-returns=6 | ||
max-branches=13 | ||
max-statements=50 | ||
max-parents=7 | ||
max-attributes=30 | ||
min-public-methods=1 | ||
max-public-methods=20 | ||
max-bool-expr=5 | ||
|
||
[EXCEPTIONS] | ||
overgeneral-exceptions=Exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
def Counter32(a, b, delta): | ||
""" | ||
.. module:: aggregators | ||
:synopsis: Aggregation functions | ||
.. moduleauthor:: Colin Alston <colin@imcol.in> | ||
""" | ||
|
||
|
||
def Counter32(al, br, delta): | ||
"""32bit counter aggregator with wrapping | ||
""" | ||
if b < a: | ||
c = 4294967295 - a | ||
return (c + b) / float(delta) | ||
if br < al: | ||
ch = 4294967295 - al | ||
return (ch + br) / float(delta) | ||
|
||
return (b - a) / float(delta) | ||
return (br - al) / float(delta) | ||
|
||
def Counter64(a, b, delta): | ||
def Counter64(al, br, delta): | ||
"""64bit counter aggregator with wrapping | ||
""" | ||
if b < a: | ||
c = 18446744073709551615 - a | ||
return (c + b) / float(delta) | ||
if br < al: | ||
ch = 18446744073709551615 - al | ||
return (ch + br) / float(delta) | ||
|
||
return (b - a) / float(delta) | ||
return (br - al) / float(delta) | ||
|
||
def Counter(a, b, delta): | ||
def Counter(al, br, delta): | ||
"""Counter derivative | ||
""" | ||
if b < a: | ||
return None | ||
if br < al: | ||
return None | ||
|
||
return (b - a) / float(delta) | ||
return (br - al) / float(delta) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.