diff --git a/pylint.html b/pylint.html index 2f476c4..7cd5854 100644 --- a/pylint.html +++ b/pylint.html @@ -1,266 +1,407 @@ -
- + + -missing-docstring
+
+div.code {
+ font-size: 150%
+}
+
+
+
+
+
+
+
+
+ Pylint, Warnings e Correções
+
+
+
+
+ missing-docstring
+
+
+
+ O que é o erro
+
+
def funcao(valor):
- return valor * 2
-
-
-
-
-
- Solução:
-
- Documente suas funções!
-
-
-
-
-
- wildcard-import
-
-
-
-
-
- unused-import
-
-
-
-
-
- unused-argument
-
-
-
-
-
- bare-except
-
-
-
-
-
- no-self-use
-
-
-
-
-
- old-style-class
-
-
-
-
-
- super-on-old-class
-
-
-
-
-
- no-init
-
-
-
-
-
- super-init-not-called
-
-
-
-
-
- attribute-defined-outside-init
-
-
-
-
-
- abstract-method
-
-
-
-
-
- arguments-differ
-
-
-
-
-
- no-member
e maybe-no-member
-
-
-
-
-
- no-value-for-parameter
-
-
-
-
-
- protected-access
-
-
-
-
-
- too-few-public-methods
-
-
-
-
-
- too-many-ancestors
-
-
-
-
-
- too-many-arguments
-
-
-
-
-
- too-many-branches
-
-
-
-
-
- too-many-instance-attributes
-
-
-
-
-
- too-many-lines
-
-
-
-
-
- too-many-locals
-
-
-
-
-
- too-many-public-methods
-
-
-
-
-
- too-many-statements
-
-
-
-
-
- invalid-name
-
-
-
-
-
- star-args
-
-
-
-
-
-
-
-
-
-
-
+ return valor * 2
+
+ Documente suas funções!
+wildcard-import
+from module import *
+
+ Importe apenas as funções módulos que são usados.
+if __name__ == '__main__'
unused-import
+from module import function
+
+ (E function()
não é usado em lugar algum.)
Remova o import.
+Quebrar imports em várias linhas facilita correção desse + tipo de problema.
+ +
+from module import func1
+from module import func2
+
+ unused-argument
+def func(arg1, arg2):
+ return arg1 * 2
+
+
+def addSeven(foo): # "Unused argument 'foo'"
+ foo += [7]
+
+ O problema é a questão de referência para objetos + mutáveis. O código em si está errado.
+bare-except
+try:
+ func()
+except Exception e:
+ pass
+
+ Capture apenas as exceções que você sabe lidar.
+no-self-use
+class A(object):
+ def func(self, a):
+ return a * 2
+
+ A solução mais "correta" é tirar a função da classe e deixar + fora do objeto.
+ +Não sendo possível,
+ # pylint:disable=no-self-use
antes da função.
+
old-style-class
super-on-old-class
no-init
super-init-not-called
attribute-defined-outside-init
abstract-method
arguments-differ
no-member
e maybe-no-member
no-value-for-parameter
protected-access
too-few-public-methods
too-many-ancestors
too-many-arguments
too-many-branches
too-many-instance-attributes
too-many-lines
too-many-locals
too-many-public-methods
too-many-statements
invalid-name
star-args