├── .flake8 ├── .gitignore ├── .pre-commit-config.yaml ├── .pylintrc ├── requirements.txt ├── run.py └── src ├── start.py └── start_test.py /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = E722, W503 3 | max-line-length = 100 4 | per-file-ignores = 5 | __init__.py: F401 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/__pycache__ 2 | .pytest_cache 3 | venv -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/ambv/black 3 | rev: stable 4 | hooks: 5 | - id: black 6 | language_version: python3.8 7 | stages: [commit] 8 | - repo: https://gitlab.com/pycqa/flake8 9 | rev: 3.7.9 10 | hooks: 11 | - id: flake8 12 | stages: [commit] 13 | - repo: local 14 | hooks: 15 | - id: pytest 16 | name: pytest 17 | language: system 18 | entry: pytest -v 19 | always_run: true 20 | pass_filenames: false 21 | stages: [commit] 22 | - repo: local 23 | hooks: 24 | - id: requirements 25 | name: requirements 26 | entry: bash -c 'venv/bin/pip3 freeze > requirements.txt; git add requirements.txt' 27 | language: system 28 | pass_filenames: false 29 | stages: [commit] 30 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | 3 | disable= 4 | C0114, # missing-module-docstring 5 | 6 | # A comma-separated list of package or module names from where C extensions may 7 | # be loaded. Extensions are loading into the active Python interpreter and may 8 | # run arbitrary code. 9 | extension-pkg-whitelist= 10 | 11 | # Specify a score threshold to be exceeded before program exits with error. 12 | fail-under=10.0 13 | 14 | # Add files or directories to the blacklist. They should be base names, not 15 | # paths. 16 | ignore=CVS 17 | 18 | # Add files or directories matching the regex patterns to the blacklist. The 19 | # regex matches against base names, not paths. 20 | ignore-patterns= 21 | 22 | # Python code to execute, usually for sys.path manipulation such as 23 | # pygtk.require(). 24 | #init-hook= 25 | 26 | # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the 27 | # number of processors available to use. 28 | jobs=1 29 | 30 | # Control the amount of potential inferred values when inferring a single 31 | # object. This can help the performance when dealing with large functions or 32 | # complex, nested conditions. 33 | limit-inference-results=100 34 | 35 | # List of plugins (as comma separated values of python module names) to load, 36 | # usually to register additional checkers. 37 | load-plugins= 38 | 39 | # Pickle collected data for later comparisons. 40 | persistent=yes 41 | 42 | # When enabled, pylint would attempt to guess common misconfiguration and emit 43 | # user-friendly hints instead of false-positive error messages. 44 | suggestion-mode=yes 45 | 46 | # Allow loading of arbitrary C extensions. Extensions are imported into the 47 | # active Python interpreter and may run arbitrary code. 48 | unsafe-load-any-extension=no 49 | 50 | 51 | [MESSAGES CONTROL] 52 | 53 | # Only show warnings with the listed confidence levels. Leave empty to show 54 | # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. 55 | confidence= 56 | 57 | # Disable the message, report, category or checker with the given id(s). You 58 | # can either give multiple identifiers separated by comma (,) or put this 59 | # option multiple times (only on the command line, not in the configuration 60 | # file where it should appear only once). You can also use "--disable=all" to 61 | # disable everything first and then reenable specific checks. For example, if 62 | # you want to run only the similarities checker, you can use "--disable=all 63 | # --enable=similarities". If you want to run only the classes checker, but have 64 | # no Warning level messages displayed, use "--disable=all --enable=classes 65 | # --disable=W". 66 | disable=print-statement, 67 | parameter-unpacking, 68 | unpacking-in-except, 69 | old-raise-syntax, 70 | backtick, 71 | long-suffix, 72 | old-ne-operator, 73 | old-octal-literal, 74 | import-star-module-level, 75 | non-ascii-bytes-literal, 76 | raw-checker-failed, 77 | bad-inline-option, 78 | locally-disabled, 79 | file-ignored, 80 | suppressed-message, 81 | useless-suppression, 82 | deprecated-pragma, 83 | use-symbolic-message-instead, 84 | apply-builtin, 85 | basestring-builtin, 86 | buffer-builtin, 87 | cmp-builtin, 88 | coerce-builtin, 89 | execfile-builtin, 90 | file-builtin, 91 | long-builtin, 92 | raw_input-builtin, 93 | reduce-builtin, 94 | standarderror-builtin, 95 | unicode-builtin, 96 | xrange-builtin, 97 | coerce-method, 98 | delslice-method, 99 | getslice-method, 100 | setslice-method, 101 | no-absolute-import, 102 | old-division, 103 | dict-iter-method, 104 | dict-view-method, 105 | next-method-called, 106 | metaclass-assignment, 107 | indexing-exception, 108 | raising-string, 109 | reload-builtin, 110 | oct-method, 111 | hex-method, 112 | nonzero-method, 113 | cmp-method, 114 | input-builtin, 115 | round-builtin, 116 | intern-builtin, 117 | unichr-builtin, 118 | map-builtin-not-iterating, 119 | zip-builtin-not-iterating, 120 | range-builtin-not-iterating, 121 | filter-builtin-not-iterating, 122 | using-cmp-argument, 123 | eq-without-hash, 124 | div-method, 125 | idiv-method, 126 | rdiv-method, 127 | exception-message-attribute, 128 | invalid-str-codec, 129 | sys-max-int, 130 | bad-python3-import, 131 | deprecated-string-function, 132 | deprecated-str-translate-call, 133 | deprecated-itertools-function, 134 | deprecated-types-field, 135 | next-method-defined, 136 | dict-items-not-iterating, 137 | dict-keys-not-iterating, 138 | dict-values-not-iterating, 139 | deprecated-operator-function, 140 | deprecated-urllib-function, 141 | xreadlines-attribute, 142 | deprecated-sys-function, 143 | exception-escape, 144 | comprehension-escape 145 | 146 | # Enable the message, report, category or checker with the given id(s). You can 147 | # either give multiple identifier separated by comma (,) or put this option 148 | # multiple time (only on the command line, not in the configuration file where 149 | # it should appear only once). See also the "--disable" option for examples. 150 | enable=c-extension-no-member 151 | 152 | 153 | [REPORTS] 154 | 155 | # Python expression which should return a score less than or equal to 10. You 156 | # have access to the variables 'error', 'warning', 'refactor', and 'convention' 157 | # which contain the number of messages in each category, as well as 'statement' 158 | # which is the total number of statements analyzed. This score is used by the 159 | # global evaluation report (RP0004). 160 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 161 | 162 | # Template used to display messages. This is a python new-style format string 163 | # used to format the message information. See doc for all details. 164 | #msg-template= 165 | 166 | # Set the output format. Available formats are text, parseable, colorized, json 167 | # and msvs (visual studio). You can also give a reporter class, e.g. 168 | # mypackage.mymodule.MyReporterClass. 169 | output-format=text 170 | 171 | # Tells whether to display a full report or only the messages. 172 | reports=no 173 | 174 | # Activate the evaluation score. 175 | score=yes 176 | 177 | 178 | [REFACTORING] 179 | 180 | # Maximum number of nested blocks for function / method body 181 | max-nested-blocks=5 182 | 183 | # Complete name of functions that never returns. When checking for 184 | # inconsistent-return-statements if a never returning function is called then 185 | # it will be considered as an explicit return statement and no message will be 186 | # printed. 187 | never-returning-functions=sys.exit 188 | 189 | 190 | [FORMAT] 191 | 192 | # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. 193 | expected-line-ending-format= 194 | 195 | # Regexp for a line that is allowed to be longer than the limit. 196 | ignore-long-lines=^\s*(# )??$ 197 | 198 | # Number of spaces of indent required inside a hanging or continued line. 199 | indent-after-paren=4 200 | 201 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 202 | # tab). 203 | indent-string=' ' 204 | 205 | # Maximum number of characters on a single line. 206 | max-line-length=100 207 | 208 | # Maximum number of lines in a module. 209 | max-module-lines=1000 210 | 211 | # Allow the body of a class to be on the same line as the declaration if body 212 | # contains single statement. 213 | single-line-class-stmt=no 214 | 215 | # Allow the body of an if to be on the same line as the test if there is no 216 | # else. 217 | single-line-if-stmt=no 218 | 219 | 220 | [MISCELLANEOUS] 221 | 222 | # List of note tags to take in consideration, separated by a comma. 223 | notes=FIXME, 224 | XXX, 225 | TODO 226 | 227 | # Regular expression of note tags to take in consideration. 228 | #notes-rgx= 229 | 230 | 231 | [SIMILARITIES] 232 | 233 | # Ignore comments when computing similarities. 234 | ignore-comments=yes 235 | 236 | # Ignore docstrings when computing similarities. 237 | ignore-docstrings=yes 238 | 239 | # Ignore imports when computing similarities. 240 | ignore-imports=no 241 | 242 | # Minimum lines number of a similarity. 243 | min-similarity-lines=4 244 | 245 | 246 | [STRING] 247 | 248 | # This flag controls whether inconsistent-quotes generates a warning when the 249 | # character used as a quote delimiter is used inconsistently within a module. 250 | check-quote-consistency=no 251 | 252 | # This flag controls whether the implicit-str-concat should generate a warning 253 | # on implicit string concatenation in sequences defined over several lines. 254 | check-str-concat-over-line-jumps=no 255 | 256 | 257 | [TYPECHECK] 258 | 259 | # List of decorators that produce context managers, such as 260 | # contextlib.contextmanager. Add to this list to register other decorators that 261 | # produce valid context managers. 262 | contextmanager-decorators=contextlib.contextmanager 263 | 264 | # List of members which are set dynamically and missed by pylint inference 265 | # system, and so shouldn't trigger E1101 when accessed. Python regular 266 | # expressions are accepted. 267 | generated-members= 268 | 269 | # Tells whether missing members accessed in mixin class should be ignored. A 270 | # mixin class is detected if its name ends with "mixin" (case insensitive). 271 | ignore-mixin-members=yes 272 | 273 | # Tells whether to warn about missing members when the owner of the attribute 274 | # is inferred to be None. 275 | ignore-none=yes 276 | 277 | # This flag controls whether pylint should warn about no-member and similar 278 | # checks whenever an opaque object is returned when inferring. The inference 279 | # can return multiple potential results while evaluating a Python object, but 280 | # some branches might not be evaluated, which results in partial inference. In 281 | # that case, it might be useful to still emit no-member and other checks for 282 | # the rest of the inferred objects. 283 | ignore-on-opaque-inference=yes 284 | 285 | # List of class names for which member attributes should not be checked (useful 286 | # for classes with dynamically set attributes). This supports the use of 287 | # qualified names. 288 | ignored-classes=optparse.Values,thread._local,_thread._local 289 | 290 | # List of module names for which member attributes should not be checked 291 | # (useful for modules/projects where namespaces are manipulated during runtime 292 | # and thus existing member attributes cannot be deduced by static analysis). It 293 | # supports qualified module names, as well as Unix pattern matching. 294 | ignored-modules= 295 | 296 | # Show a hint with possible names when a member name was not found. The aspect 297 | # of finding the hint is based on edit distance. 298 | missing-member-hint=yes 299 | 300 | # The minimum edit distance a name should have in order to be considered a 301 | # similar match for a missing member name. 302 | missing-member-hint-distance=1 303 | 304 | # The total number of similar names that should be taken in consideration when 305 | # showing a hint for a missing member. 306 | missing-member-max-choices=1 307 | 308 | # List of decorators that change the signature of a decorated function. 309 | signature-mutators= 310 | 311 | 312 | [BASIC] 313 | 314 | # Naming style matching correct argument names. 315 | argument-naming-style=snake_case 316 | 317 | # Regular expression matching correct argument names. Overrides argument- 318 | # naming-style. 319 | #argument-rgx= 320 | 321 | # Naming style matching correct attribute names. 322 | attr-naming-style=snake_case 323 | 324 | # Regular expression matching correct attribute names. Overrides attr-naming- 325 | # style. 326 | #attr-rgx= 327 | 328 | # Bad variable names which should always be refused, separated by a comma. 329 | bad-names=foo, 330 | bar, 331 | baz, 332 | toto, 333 | tutu, 334 | tata 335 | 336 | # Bad variable names regexes, separated by a comma. If names match any regex, 337 | # they will always be refused 338 | bad-names-rgxs= 339 | 340 | # Naming style matching correct class attribute names. 341 | class-attribute-naming-style=any 342 | 343 | # Regular expression matching correct class attribute names. Overrides class- 344 | # attribute-naming-style. 345 | #class-attribute-rgx= 346 | 347 | # Naming style matching correct class names. 348 | class-naming-style=PascalCase 349 | 350 | # Regular expression matching correct class names. Overrides class-naming- 351 | # style. 352 | #class-rgx= 353 | 354 | # Naming style matching correct constant names. 355 | const-naming-style=UPPER_CASE 356 | 357 | # Regular expression matching correct constant names. Overrides const-naming- 358 | # style. 359 | #const-rgx= 360 | 361 | # Minimum line length for functions/classes that require docstrings, shorter 362 | # ones are exempt. 363 | docstring-min-length=-1 364 | 365 | # Naming style matching correct function names. 366 | function-naming-style=snake_case 367 | 368 | # Regular expression matching correct function names. Overrides function- 369 | # naming-style. 370 | #function-rgx= 371 | 372 | # Good variable names which should always be accepted, separated by a comma. 373 | good-names=i, 374 | j, 375 | k, 376 | ex, 377 | Run, 378 | _ 379 | 380 | # Good variable names regexes, separated by a comma. If names match any regex, 381 | # they will always be accepted 382 | good-names-rgxs= 383 | 384 | # Include a hint for the correct naming format with invalid-name. 385 | include-naming-hint=no 386 | 387 | # Naming style matching correct inline iteration names. 388 | inlinevar-naming-style=any 389 | 390 | # Regular expression matching correct inline iteration names. Overrides 391 | # inlinevar-naming-style. 392 | #inlinevar-rgx= 393 | 394 | # Naming style matching correct method names. 395 | method-naming-style=snake_case 396 | 397 | # Regular expression matching correct method names. Overrides method-naming- 398 | # style. 399 | #method-rgx= 400 | 401 | # Naming style matching correct module names. 402 | module-naming-style=snake_case 403 | 404 | # Regular expression matching correct module names. Overrides module-naming- 405 | # style. 406 | #module-rgx= 407 | 408 | # Colon-delimited sets of names that determine each other's naming style when 409 | # the name regexes allow several styles. 410 | name-group= 411 | 412 | # Regular expression which should only match function or class names that do 413 | # not require a docstring. 414 | no-docstring-rgx=^_ 415 | 416 | # List of decorators that produce properties, such as abc.abstractproperty. Add 417 | # to this list to register other decorators that produce valid properties. 418 | # These decorators are taken in consideration only for invalid-name. 419 | property-classes=abc.abstractproperty 420 | 421 | # Naming style matching correct variable names. 422 | variable-naming-style=snake_case 423 | 424 | # Regular expression matching correct variable names. Overrides variable- 425 | # naming-style. 426 | #variable-rgx= 427 | 428 | 429 | [LOGGING] 430 | 431 | # The type of string formatting that logging methods do. `old` means using % 432 | # formatting, `new` is for `{}` formatting. 433 | logging-format-style=old 434 | 435 | # Logging modules to check that the string format arguments are in logging 436 | # function parameter format. 437 | logging-modules=logging 438 | 439 | 440 | [SPELLING] 441 | 442 | # Limits count of emitted suggestions for spelling mistakes. 443 | max-spelling-suggestions=4 444 | 445 | # Spelling dictionary name. Available dictionaries: none. To make it work, 446 | # install the python-enchant package. 447 | spelling-dict= 448 | 449 | # List of comma separated words that should not be checked. 450 | spelling-ignore-words= 451 | 452 | # A path to a file that contains the private dictionary; one word per line. 453 | spelling-private-dict-file= 454 | 455 | # Tells whether to store unknown words to the private dictionary (see the 456 | # --spelling-private-dict-file option) instead of raising a message. 457 | spelling-store-unknown-words=no 458 | 459 | 460 | [VARIABLES] 461 | 462 | # List of additional names supposed to be defined in builtins. Remember that 463 | # you should avoid defining new builtins when possible. 464 | additional-builtins= 465 | 466 | # Tells whether unused global variables should be treated as a violation. 467 | allow-global-unused-variables=yes 468 | 469 | # List of strings which can identify a callback function by name. A callback 470 | # name must start or end with one of those strings. 471 | callbacks=cb_, 472 | _cb 473 | 474 | # A regular expression matching the name of dummy variables (i.e. expected to 475 | # not be used). 476 | dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ 477 | 478 | # Argument names that match this expression will be ignored. Default to name 479 | # with leading underscore. 480 | ignored-argument-names=_.*|^ignored_|^unused_ 481 | 482 | # Tells whether we should check for unused import in __init__ files. 483 | init-import=no 484 | 485 | # List of qualified module names which can have objects that can redefine 486 | # builtins. 487 | redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io 488 | 489 | 490 | [DESIGN] 491 | 492 | # Maximum number of arguments for function / method. 493 | max-args=5 494 | 495 | # Maximum number of attributes for a class (see R0902). 496 | max-attributes=7 497 | 498 | # Maximum number of boolean expressions in an if statement (see R0916). 499 | max-bool-expr=5 500 | 501 | # Maximum number of branch for function / method body. 502 | max-branches=12 503 | 504 | # Maximum number of locals for function / method body. 505 | max-locals=15 506 | 507 | # Maximum number of parents for a class (see R0901). 508 | max-parents=7 509 | 510 | # Maximum number of public methods for a class (see R0904). 511 | max-public-methods=20 512 | 513 | # Maximum number of return / yield for function / method body. 514 | max-returns=6 515 | 516 | # Maximum number of statements in function / method body. 517 | max-statements=50 518 | 519 | # Minimum number of public methods for a class (see R0903). 520 | min-public-methods=1 521 | 522 | 523 | [CLASSES] 524 | 525 | # List of method names used to declare (i.e. assign) instance attributes. 526 | defining-attr-methods=__init__, 527 | __new__, 528 | setUp, 529 | __post_init__ 530 | 531 | # List of member names, which should be excluded from the protected access 532 | # warning. 533 | exclude-protected=_asdict, 534 | _fields, 535 | _replace, 536 | _source, 537 | _make 538 | 539 | # List of valid names for the first argument in a class method. 540 | valid-classmethod-first-arg=cls 541 | 542 | # List of valid names for the first argument in a metaclass class method. 543 | valid-metaclass-classmethod-first-arg=cls 544 | 545 | 546 | [IMPORTS] 547 | 548 | # List of modules that can be imported at any level, not just the top level 549 | # one. 550 | allow-any-import-level= 551 | 552 | # Allow wildcard imports from modules that define __all__. 553 | allow-wildcard-with-all=no 554 | 555 | # Analyse import fallback blocks. This can be used to support both Python 2 and 556 | # 3 compatible code, which means that the block might have code that exists 557 | # only in one or another interpreter, leading to false positives when analysed. 558 | analyse-fallback-blocks=no 559 | 560 | # Deprecated modules which should not be used, separated by a comma. 561 | deprecated-modules=optparse,tkinter.tix 562 | 563 | # Create a graph of external dependencies in the given file (report RP0402 must 564 | # not be disabled). 565 | ext-import-graph= 566 | 567 | # Create a graph of every (i.e. internal and external) dependencies in the 568 | # given file (report RP0402 must not be disabled). 569 | import-graph= 570 | 571 | # Create a graph of internal dependencies in the given file (report RP0402 must 572 | # not be disabled). 573 | int-import-graph= 574 | 575 | # Force import order to recognize a module as part of the standard 576 | # compatibility libraries. 577 | known-standard-library= 578 | 579 | # Force import order to recognize a module as part of a third party library. 580 | known-third-party=enchant 581 | 582 | # Couples of modules and preferred modules, separated by a comma. 583 | preferred-modules= 584 | 585 | 586 | [EXCEPTIONS] 587 | 588 | # Exceptions that will emit a warning when being caught. Defaults to 589 | # "BaseException, Exception". 590 | overgeneral-exceptions=BaseException, 591 | Exception 592 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4 2 | astroid==2.4.2 3 | attrs==20.3.0 4 | black==20.8b1 5 | cfgv==3.2.0 6 | click==7.1.2 7 | distlib==0.3.1 8 | filelock==3.0.12 9 | freeze==3.0 10 | identify==1.5.10 11 | iniconfig==1.1.1 12 | isort==5.6.4 13 | lazy-object-proxy==1.4.3 14 | mccabe==0.6.1 15 | mypy-extensions==0.4.3 16 | nodeenv==1.5.0 17 | packaging==20.8 18 | pathspec==0.8.1 19 | pluggy==0.13.1 20 | pre-commit==2.9.3 21 | py==1.10.0 22 | pylint==2.6.0 23 | pyparsing==2.4.7 24 | pytest==6.1.2 25 | PyYAML==5.3.1 26 | regex==2020.11.13 27 | six==1.15.0 28 | toml==0.10.2 29 | typed-ast==1.4.1 30 | typing-extensions==3.7.4.3 31 | virtualenv==20.2.2 32 | wrapt==1.12.1 33 | -------------------------------------------------------------------------------- /run.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/programadorLhama/python_settings/4a5d804aee0fa65f087aec73d1c212396ca01d8e/run.py -------------------------------------------------------------------------------- /src/start.py: -------------------------------------------------------------------------------- 1 | def start_function(): 2 | """ Printing something """ 3 | 4 | print("Ola mundo") 5 | -------------------------------------------------------------------------------- /src/start_test.py: -------------------------------------------------------------------------------- 1 | def test_numero_1(): 2 | assert True is True 3 | --------------------------------------------------------------------------------