├── tests ├── __init__.py └── test_calculator.py ├── src └── calculator.py ├── .gitignore ├── Pipfile ├── Makefile ├── Pipfile.lock └── .pylintrc /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/calculator.py: -------------------------------------------------------------------------------- 1 | def add(number1: int, number2: int) -> int: 2 | return 0 3 | 4 | 5 | def multiply(number1: int, number2: int) -> int: 6 | return 0 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vscode/ 3 | .pytest_cache/ 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | .python-version 8 | **/*.pyc 9 | **/__pycache__ 10 | .DS_Store 11 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | 8 | [dev-packages] 9 | pytest = "*" 10 | pytest-watch = "*" 11 | black = "*" 12 | pylint = "*" 13 | pyhamcrest = "*" 14 | 15 | [requires] 16 | python_version = "3.12.0" 17 | -------------------------------------------------------------------------------- /tests/test_calculator.py: -------------------------------------------------------------------------------- 1 | from hamcrest import assert_that, equal_to 2 | from src.calculator import add, multiply 3 | 4 | 5 | def test_adds_two_numbers(): 6 | assert_that(add(1, 2), equal_to(3)) 7 | 8 | 9 | def test_multiply_two_numbers(): 10 | assert_that(multiply(1, 2), equal_to(2)) 11 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := help 2 | 3 | .PHONY: help 4 | help: ## Show this help 5 | @grep -E '^\S+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | \ 6 | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}' 7 | 8 | .PHONY: setup 9 | setup: ## Setup local environment 10 | @pipenv install --dev 11 | 12 | .PHONY: test 13 | test: ## Locally run unit tests 14 | @PIPENV_VERBOSITY=-1 pipenv run pytest 15 | 16 | .PHONY: test-watch 17 | test-watch: ## Locally run unit tests in watch mode 18 | @PIPENV_VERBOSITY=-1 pipenv run ptw 19 | 20 | .PHONY: lint 21 | lint: ## Lint and fix code 22 | @PIPENV_VERBOSITY=-1 23 | @pipenv run black --target-version=py312 . 24 | @pipenv run pylint --recursive=y . -------------------------------------------------------------------------------- /Pipfile.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_meta": { 3 | "hash": { 4 | "sha256": "28f621de04b57317543e0257d49edc9d1c6f5cbe022541ffa3a9498fbfe268ac" 5 | }, 6 | "pipfile-spec": 6, 7 | "requires": { 8 | "python_version": "3.12.0" 9 | }, 10 | "sources": [ 11 | { 12 | "name": "pypi", 13 | "url": "https://pypi.org/simple", 14 | "verify_ssl": true 15 | } 16 | ] 17 | }, 18 | "default": {}, 19 | "develop": { 20 | "astroid": { 21 | "hashes": [ 22 | "sha256:7d5895c9825e18079c5aeac0572bc2e4c83205c95d416e0b4fee8bc361d2d9ca", 23 | "sha256:86b0bb7d7da0be1a7c4aedb7974e391b32d4ed89e33de6ed6902b4b15c97577e" 24 | ], 25 | "markers": "python_full_version >= '3.8.0'", 26 | "version": "==3.0.1" 27 | }, 28 | "black": { 29 | "hashes": [ 30 | "sha256:037e9b4664cafda5f025a1728c50a9e9aedb99a759c89f760bd83730e76ba884", 31 | "sha256:1b917a2aa020ca600483a7b340c165970b26e9029067f019e3755b56e8dd5916", 32 | "sha256:1f8ce316753428ff68749c65a5f7844631aa18c8679dfd3ca9dc1a289979c258", 33 | "sha256:33d40f5b06be80c1bbce17b173cda17994fbad096ce60eb22054da021bf933d1", 34 | "sha256:3f157a8945a7b2d424da3335f7ace89c14a3b0625e6593d21139c2d8214d55ce", 35 | "sha256:5ed45ac9a613fb52dad3b61c8dea2ec9510bf3108d4db88422bacc7d1ba1243d", 36 | "sha256:6d23d7822140e3fef190734216cefb262521789367fbdc0b3f22af6744058982", 37 | "sha256:7670242e90dc129c539e9ca17665e39a146a761e681805c54fbd86015c7c84f7", 38 | "sha256:7b4d10b0f016616a0d93d24a448100adf1699712fb7a4efd0e2c32bbb219b173", 39 | "sha256:7cb5936e686e782fddb1c73f8aa6f459e1ad38a6a7b0e54b403f1f05a1507ee9", 40 | "sha256:7d56124b7a61d092cb52cce34182a5280e160e6aff3137172a68c2c2c4b76bcb", 41 | "sha256:840015166dbdfbc47992871325799fd2dc0dcf9395e401ada6d88fe11498abad", 42 | "sha256:9c74de4c77b849e6359c6f01987e94873c707098322b91490d24296f66d067dc", 43 | "sha256:b15b75fc53a2fbcac8a87d3e20f69874d161beef13954747e053bca7a1ce53a0", 44 | "sha256:cfcce6f0a384d0da692119f2d72d79ed07c7159879d0bb1bb32d2e443382bf3a", 45 | "sha256:d431e6739f727bb2e0495df64a6c7a5310758e87505f5f8cde9ff6c0f2d7e4fe", 46 | "sha256:e293e4c2f4a992b980032bbd62df07c1bcff82d6964d6c9496f2cd726e246ace", 47 | "sha256:ec3f8e6234c4e46ff9e16d9ae96f4ef69fa328bb4ad08198c8cee45bb1f08c69" 48 | ], 49 | "index": "pypi", 50 | "markers": "python_version >= '3.8'", 51 | "version": "==23.10.1" 52 | }, 53 | "click": { 54 | "hashes": [ 55 | "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", 56 | "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" 57 | ], 58 | "markers": "python_version >= '3.7'", 59 | "version": "==8.1.7" 60 | }, 61 | "colorama": { 62 | "hashes": [ 63 | "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", 64 | "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" 65 | ], 66 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'", 67 | "version": "==0.4.6" 68 | }, 69 | "dill": { 70 | "hashes": [ 71 | "sha256:76b122c08ef4ce2eedcd4d1abd8e641114bfc6c2867f49f3c41facf65bf19f5e", 72 | "sha256:cc1c8b182eb3013e24bd475ff2e9295af86c1a38eb1aff128dac8962a9ce3c03" 73 | ], 74 | "markers": "python_version >= '3.11'", 75 | "version": "==0.3.7" 76 | }, 77 | "docopt": { 78 | "hashes": [ 79 | "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491" 80 | ], 81 | "version": "==0.6.2" 82 | }, 83 | "iniconfig": { 84 | "hashes": [ 85 | "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", 86 | "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374" 87 | ], 88 | "markers": "python_version >= '3.7'", 89 | "version": "==2.0.0" 90 | }, 91 | "isort": { 92 | "hashes": [ 93 | "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504", 94 | "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6" 95 | ], 96 | "markers": "python_full_version >= '3.8.0'", 97 | "version": "==5.12.0" 98 | }, 99 | "mccabe": { 100 | "hashes": [ 101 | "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", 102 | "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" 103 | ], 104 | "markers": "python_version >= '3.6'", 105 | "version": "==0.7.0" 106 | }, 107 | "mypy-extensions": { 108 | "hashes": [ 109 | "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", 110 | "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782" 111 | ], 112 | "markers": "python_version >= '3.5'", 113 | "version": "==1.0.0" 114 | }, 115 | "packaging": { 116 | "hashes": [ 117 | "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", 118 | "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7" 119 | ], 120 | "markers": "python_version >= '3.7'", 121 | "version": "==23.2" 122 | }, 123 | "pathspec": { 124 | "hashes": [ 125 | "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20", 126 | "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3" 127 | ], 128 | "markers": "python_version >= '3.7'", 129 | "version": "==0.11.2" 130 | }, 131 | "platformdirs": { 132 | "hashes": [ 133 | "sha256:cf8ee52a3afdb965072dcc652433e0c7e3e40cf5ea1477cd4b3b1d2eb75495b3", 134 | "sha256:e9d171d00af68be50e9202731309c4e658fd8bc76f55c11c7dd760d023bda68e" 135 | ], 136 | "markers": "python_version >= '3.7'", 137 | "version": "==3.11.0" 138 | }, 139 | "pluggy": { 140 | "hashes": [ 141 | "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12", 142 | "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7" 143 | ], 144 | "markers": "python_version >= '3.8'", 145 | "version": "==1.3.0" 146 | }, 147 | "pyhamcrest": { 148 | "hashes": [ 149 | "sha256:c6acbec0923d0cb7e72c22af1926f3e7c97b8e8d69fc7498eabacaf7c975bd9c", 150 | "sha256:f6913d2f392e30e0375b3ecbd7aee79e5d1faa25d345c8f4ff597665dcac2587" 151 | ], 152 | "index": "pypi", 153 | "markers": "python_version >= '3.6'", 154 | "version": "==2.1.0" 155 | }, 156 | "pylint": { 157 | "hashes": [ 158 | "sha256:0d4c286ef6d2f66c8bfb527a7f8a629009e42c99707dec821a03e1b51a4c1496", 159 | "sha256:60ed5f3a9ff8b61839ff0348b3624ceeb9e6c2a92c514d81c9cc273da3b6bcda" 160 | ], 161 | "index": "pypi", 162 | "markers": "python_full_version >= '3.8.0'", 163 | "version": "==3.0.2" 164 | }, 165 | "pytest": { 166 | "hashes": [ 167 | "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac", 168 | "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5" 169 | ], 170 | "index": "pypi", 171 | "markers": "python_version >= '3.7'", 172 | "version": "==7.4.3" 173 | }, 174 | "pytest-watch": { 175 | "hashes": [ 176 | "sha256:06136f03d5b361718b8d0d234042f7b2f203910d8568f63df2f866b547b3d4b9" 177 | ], 178 | "index": "pypi", 179 | "version": "==4.2.0" 180 | }, 181 | "tomlkit": { 182 | "hashes": [ 183 | "sha256:38e1ff8edb991273ec9f6181244a6a391ac30e9f5098e7535640ea6be97a7c86", 184 | "sha256:712cbd236609acc6a3e2e97253dfc52d4c2082982a88f61b640ecf0817eab899" 185 | ], 186 | "markers": "python_version >= '3.7'", 187 | "version": "==0.12.1" 188 | }, 189 | "watchdog": { 190 | "hashes": [ 191 | "sha256:0e06ab8858a76e1219e68c7573dfeba9dd1c0219476c5a44d5333b01d7e1743a", 192 | "sha256:13bbbb462ee42ec3c5723e1205be8ced776f05b100e4737518c67c8325cf6100", 193 | "sha256:233b5817932685d39a7896b1090353fc8efc1ef99c9c054e46c8002561252fb8", 194 | "sha256:25f70b4aa53bd743729c7475d7ec41093a580528b100e9a8c5b5efe8899592fc", 195 | "sha256:2b57a1e730af3156d13b7fdddfc23dea6487fceca29fc75c5a868beed29177ae", 196 | "sha256:336adfc6f5cc4e037d52db31194f7581ff744b67382eb6021c868322e32eef41", 197 | "sha256:3aa7f6a12e831ddfe78cdd4f8996af9cf334fd6346531b16cec61c3b3c0d8da0", 198 | "sha256:3ed7c71a9dccfe838c2f0b6314ed0d9b22e77d268c67e015450a29036a81f60f", 199 | "sha256:4c9956d27be0bb08fc5f30d9d0179a855436e655f046d288e2bcc11adfae893c", 200 | "sha256:4d98a320595da7a7c5a18fc48cb633c2e73cda78f93cac2ef42d42bf609a33f9", 201 | "sha256:4f94069eb16657d2c6faada4624c39464f65c05606af50bb7902e036e3219be3", 202 | "sha256:5113334cf8cf0ac8cd45e1f8309a603291b614191c9add34d33075727a967709", 203 | "sha256:51f90f73b4697bac9c9a78394c3acbbd331ccd3655c11be1a15ae6fe289a8c83", 204 | "sha256:5d9f3a10e02d7371cd929b5d8f11e87d4bad890212ed3901f9b4d68767bee759", 205 | "sha256:7ade88d0d778b1b222adebcc0927428f883db07017618a5e684fd03b83342bd9", 206 | "sha256:7c5f84b5194c24dd573fa6472685b2a27cc5a17fe5f7b6fd40345378ca6812e3", 207 | "sha256:7e447d172af52ad204d19982739aa2346245cc5ba6f579d16dac4bfec226d2e7", 208 | "sha256:8ae9cda41fa114e28faf86cb137d751a17ffd0316d1c34ccf2235e8a84365c7f", 209 | "sha256:8f3ceecd20d71067c7fd4c9e832d4e22584318983cabc013dbf3f70ea95de346", 210 | "sha256:9fac43a7466eb73e64a9940ac9ed6369baa39b3bf221ae23493a9ec4d0022674", 211 | "sha256:a70a8dcde91be523c35b2bf96196edc5730edb347e374c7de7cd20c43ed95397", 212 | "sha256:adfdeab2da79ea2f76f87eb42a3ab1966a5313e5a69a0213a3cc06ef692b0e96", 213 | "sha256:ba07e92756c97e3aca0912b5cbc4e5ad802f4557212788e72a72a47ff376950d", 214 | "sha256:c07253088265c363d1ddf4b3cdb808d59a0468ecd017770ed716991620b8f77a", 215 | "sha256:c9d8c8ec7efb887333cf71e328e39cffbf771d8f8f95d308ea4125bf5f90ba64", 216 | "sha256:d00e6be486affb5781468457b21a6cbe848c33ef43f9ea4a73b4882e5f188a44", 217 | "sha256:d429c2430c93b7903914e4db9a966c7f2b068dd2ebdd2fa9b9ce094c7d459f33" 218 | ], 219 | "markers": "python_version >= '3.7'", 220 | "version": "==3.0.0" 221 | } 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [MAIN] 2 | 3 | # Specify a configuration file. 4 | #rcfile= 5 | 6 | # Python code to execute, usually for sys.path manipulation such as 7 | # pygtk.require(). 8 | #init-hook= 9 | 10 | # Files or directories to be skipped. They should be base names, not 11 | # paths. 12 | ignore=CVS 13 | 14 | # Add files or directories matching the regex patterns to the ignore-list. The 15 | # regex matches against paths and can be in Posix or Windows format. 16 | ignore-paths= 17 | 18 | # Files or directories matching the regex patterns are skipped. The regex 19 | # matches against base names, not paths. 20 | ignore-patterns=^\.# 21 | 22 | # Pickle collected data for later comparisons. 23 | persistent=yes 24 | 25 | # List of plugins (as comma separated values of python modules names) to load, 26 | # usually to register additional checkers. 27 | load-plugins= 28 | pylint.extensions.check_elif, 29 | pylint.extensions.bad_builtin, 30 | pylint.extensions.docparams, 31 | pylint.extensions.for_any_all, 32 | pylint.extensions.set_membership, 33 | pylint.extensions.code_style, 34 | pylint.extensions.overlapping_exceptions, 35 | pylint.extensions.typing, 36 | pylint.extensions.redefined_variable_type, 37 | pylint.extensions.comparison_placement, 38 | pylint.extensions.mccabe, 39 | 40 | # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the 41 | # number of processors available to use. 42 | jobs=0 43 | 44 | # When enabled, pylint would attempt to guess common misconfiguration and emit 45 | # user-friendly hints instead of false-positive error messages. 46 | suggestion-mode=yes 47 | 48 | # Allow loading of arbitrary C extensions. Extensions are imported into the 49 | # active Python interpreter and may run arbitrary code. 50 | unsafe-load-any-extension=no 51 | 52 | # A comma-separated list of package or module names from where C extensions may 53 | # be loaded. Extensions are loading into the active Python interpreter and may 54 | # run arbitrary code 55 | extension-pkg-allow-list= 56 | 57 | # Minimum supported python version 58 | py-version = 3.7.2 59 | 60 | # Control the amount of potential inferred values when inferring a single 61 | # object. This can help the performance when dealing with large functions or 62 | # complex, nested conditions. 63 | limit-inference-results=100 64 | 65 | # Specify a score threshold to be exceeded before program exits with error. 66 | fail-under=10.0 67 | 68 | # Return non-zero exit code if any of these messages/categories are detected, 69 | # even if score is above --fail-under value. Syntax same as enable. Messages 70 | # specified are enabled, while categories only check already-enabled messages. 71 | fail-on= 72 | 73 | 74 | [MESSAGES CONTROL] 75 | 76 | # Only show warnings with the listed confidence levels. Leave empty to show 77 | # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED 78 | # confidence= 79 | 80 | # Enable the message, report, category or checker with the given id(s). You can 81 | # either give multiple identifier separated by comma (,) or put this option 82 | # multiple time (only on the command line, not in the configuration file where 83 | # it should appear only once). See also the "--disable" option for examples. 84 | enable= 85 | use-symbolic-message-instead, 86 | useless-suppression, 87 | 88 | # Disable the message, report, category or checker with the given id(s). You 89 | # can either give multiple identifiers separated by comma (,) or put this 90 | # option multiple times (only on the command line, not in the configuration 91 | # file where it should appear only once).You can also use "--disable=all" to 92 | # disable everything first and then re-enable specific checks. For example, if 93 | # you want to run only the similarities checker, you can use "--disable=all 94 | # --enable=similarities". If you want to run only the classes checker, but have 95 | # no Warning level messages displayed, use"--disable=all --enable=classes 96 | # --disable=W" 97 | 98 | disable= 99 | missing-docstring, 100 | invalid-name, 101 | # handled by black 102 | format, 103 | 104 | 105 | [REPORTS] 106 | 107 | # Set the output format. Available formats are text, parseable, colorized, msvs 108 | # (visual studio) and html. You can also give a reporter class, eg 109 | # mypackage.mymodule.MyReporterClass. 110 | output-format=text 111 | 112 | # Tells whether to display a full report or only the messages 113 | reports=no 114 | 115 | # Python expression which should return a note less than 10 (10 is the highest 116 | # note). You have access to the variables 'fatal', 'error', 'warning', 'refactor', 'convention' 117 | # and 'info', which contain the number of messages in each category, as 118 | # well as 'statement', which is the total number of statements analyzed. This 119 | # score is used by the global evaluation report (RP0004). 120 | evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) 121 | 122 | # Template used to display messages. This is a python new-style format string 123 | # used to format the message information. See doc for all details 124 | #msg-template= 125 | 126 | # Activate the evaluation score. 127 | score=yes 128 | 129 | 130 | [LOGGING] 131 | 132 | # Logging modules to check that the string format arguments are in logging 133 | # function parameter format 134 | logging-modules=logging 135 | 136 | # The type of string formatting that logging methods do. `old` means using % 137 | # formatting, `new` is for `{}` formatting. 138 | logging-format-style=old 139 | 140 | 141 | [MISCELLANEOUS] 142 | 143 | # List of note tags to take in consideration, separated by a comma. 144 | notes=FIXME,XXX,TODO 145 | 146 | # Regular expression of note tags to take in consideration. 147 | #notes-rgx= 148 | 149 | 150 | [SIMILARITIES] 151 | 152 | # Minimum lines number of a similarity. 153 | min-similarity-lines=6 154 | 155 | # Ignore comments when computing similarities. 156 | ignore-comments=yes 157 | 158 | # Ignore docstrings when computing similarities. 159 | ignore-docstrings=yes 160 | 161 | # Ignore imports when computing similarities. 162 | ignore-imports=yes 163 | 164 | # Signatures are removed from the similarity computation 165 | ignore-signatures=yes 166 | 167 | 168 | [VARIABLES] 169 | 170 | # Tells whether we should check for unused import in __init__ files. 171 | init-import=no 172 | 173 | # A regular expression matching the name of dummy variables (i.e. expectedly 174 | # not used). 175 | dummy-variables-rgx=_$|dummy 176 | 177 | # List of additional names supposed to be defined in builtins. Remember that 178 | # you should avoid defining new builtins when possible. 179 | additional-builtins= 180 | 181 | # List of strings which can identify a callback function by name. A callback 182 | # name must start or end with one of those strings. 183 | callbacks=cb_,_cb 184 | 185 | # Tells whether unused global variables should be treated as a violation. 186 | allow-global-unused-variables=yes 187 | 188 | # List of names allowed to shadow builtins 189 | allowed-redefined-builtins= 190 | 191 | # Argument names that match this expression will be ignored. Default to name 192 | # with leading underscore. 193 | ignored-argument-names=_.* 194 | 195 | # List of qualified module names which can have objects that can redefine 196 | # builtins. 197 | redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io 198 | 199 | 200 | [FORMAT] 201 | 202 | # Maximum number of characters on a single line. 203 | max-line-length=120 204 | 205 | # Regexp for a line that is allowed to be longer than the limit. 206 | ignore-long-lines=^\s*(# )??$ 207 | 208 | # Allow the body of an if to be on the same line as the test if there is no 209 | # else. 210 | single-line-if-stmt=no 211 | 212 | # Allow the body of a class to be on the same line as the declaration if body 213 | # contains single statement. 214 | single-line-class-stmt=no 215 | 216 | # Maximum number of lines in a module 217 | max-module-lines=1000 218 | 219 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 220 | # tab). 221 | indent-string=' ' 222 | 223 | # Number of spaces of indent required inside a hanging or continued line. 224 | indent-after-paren=4 225 | 226 | # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. 227 | expected-line-ending-format= 228 | 229 | 230 | [BASIC] 231 | 232 | # Good variable names which should always be accepted, separated by a comma 233 | good-names=i,j,k,ex,Run,_ 234 | 235 | # Good variable names regexes, separated by a comma. If names match any regex, 236 | # they will always be accepted 237 | good-names-rgxs= 238 | 239 | # Bad variable names which should always be refused, separated by a comma 240 | bad-names=foo,bar,baz,toto,tutu,tata 241 | 242 | # Bad variable names regexes, separated by a comma. If names match any regex, 243 | # they will always be refused 244 | bad-names-rgxs= 245 | 246 | # Colon-delimited sets of names that determine each other's naming style when 247 | # the name regexes allow several styles. 248 | name-group= 249 | 250 | # Include a hint for the correct naming format with invalid-name 251 | include-naming-hint=no 252 | 253 | # Naming style matching correct function names. 254 | function-naming-style=snake_case 255 | 256 | # Regular expression matching correct function names 257 | function-rgx=[a-z_][a-z0-9_]{2,30}$ 258 | 259 | # Naming style matching correct variable names. 260 | variable-naming-style=snake_case 261 | 262 | # Regular expression matching correct variable names 263 | variable-rgx=[a-z_][a-z0-9_]{2,30}$ 264 | 265 | # Naming style matching correct constant names. 266 | const-naming-style=UPPER_CASE 267 | 268 | # Regular expression matching correct constant names 269 | const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 270 | 271 | # Naming style matching correct attribute names. 272 | attr-naming-style=snake_case 273 | 274 | # Regular expression matching correct attribute names 275 | attr-rgx=[a-z_][a-z0-9_]{2,}$ 276 | 277 | # Naming style matching correct argument names. 278 | argument-naming-style=snake_case 279 | 280 | # Regular expression matching correct argument names 281 | argument-rgx=[a-z_][a-z0-9_]{2,30}$ 282 | 283 | # Naming style matching correct class attribute names. 284 | class-attribute-naming-style=any 285 | 286 | # Regular expression matching correct class attribute names 287 | class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ 288 | 289 | # Naming style matching correct class constant names. 290 | class-const-naming-style=UPPER_CASE 291 | 292 | # Regular expression matching correct class constant names. Overrides class- 293 | # const-naming-style. 294 | #class-const-rgx= 295 | 296 | # Naming style matching correct inline iteration names. 297 | inlinevar-naming-style=any 298 | 299 | # Regular expression matching correct inline iteration names 300 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ 301 | 302 | # Naming style matching correct class names. 303 | class-naming-style=PascalCase 304 | 305 | # Regular expression matching correct class names 306 | class-rgx=[A-Z_][a-zA-Z0-9]+$ 307 | 308 | 309 | # Naming style matching correct module names. 310 | module-naming-style=snake_case 311 | 312 | # Regular expression matching correct module names 313 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 314 | 315 | 316 | # Naming style matching correct method names. 317 | method-naming-style=snake_case 318 | 319 | # Regular expression matching correct method names 320 | method-rgx=[a-z_][a-z0-9_]{2,}$ 321 | 322 | # Regular expression which can overwrite the naming style set by typevar-naming-style. 323 | #typevar-rgx= 324 | 325 | # Regular expression which should only match function or class names that do 326 | # not require a docstring. Use ^(?!__init__$)_ to also check __init__. 327 | no-docstring-rgx=__.*__ 328 | 329 | # Minimum line length for functions/classes that require docstrings, shorter 330 | # ones are exempt. 331 | docstring-min-length=-1 332 | 333 | # List of decorators that define properties, such as abc.abstractproperty. 334 | property-classes=abc.abstractproperty 335 | 336 | 337 | [TYPECHECK] 338 | 339 | # Regex pattern to define which classes are considered mixins if ignore-mixin- 340 | # members is set to 'yes' 341 | mixin-class-rgx=.*MixIn 342 | 343 | # List of module names for which member attributes should not be checked 344 | # (useful for modules/projects where namespaces are manipulated during runtime 345 | # and thus existing member attributes cannot be deduced by static analysis). It 346 | # supports qualified module names, as well as Unix pattern matching. 347 | ignored-modules= 348 | 349 | # List of class names for which member attributes should not be checked (useful 350 | # for classes with dynamically set attributes). This supports the use of 351 | # qualified names. 352 | ignored-classes=SQLObject, optparse.Values, thread._local, _thread._local 353 | 354 | # List of members which are set dynamically and missed by pylint inference 355 | # system, and so shouldn't trigger E1101 when accessed. Python regular 356 | # expressions are accepted. 357 | generated-members=REQUEST,acl_users,aq_parent,argparse.Namespace 358 | 359 | # List of decorators that create context managers from functions, such as 360 | # contextlib.contextmanager. 361 | contextmanager-decorators=contextlib.contextmanager 362 | 363 | # Tells whether to warn about missing members when the owner of the attribute 364 | # is inferred to be None. 365 | ignore-none=yes 366 | 367 | # This flag controls whether pylint should warn about no-member and similar 368 | # checks whenever an opaque object is returned when inferring. The inference 369 | # can return multiple potential results while evaluating a Python object, but 370 | # some branches might not be evaluated, which results in partial inference. In 371 | # that case, it might be useful to still emit no-member and other checks for 372 | # the rest of the inferred objects. 373 | ignore-on-opaque-inference=yes 374 | 375 | # Show a hint with possible names when a member name was not found. The aspect 376 | # of finding the hint is based on edit distance. 377 | missing-member-hint=yes 378 | 379 | # The minimum edit distance a name should have in order to be considered a 380 | # similar match for a missing member name. 381 | missing-member-hint-distance=1 382 | 383 | # The total number of similar names that should be taken in consideration when 384 | # showing a hint for a missing member. 385 | missing-member-max-choices=1 386 | 387 | [SPELLING] 388 | 389 | # Spelling dictionary name. Available dictionaries: none. To make it working 390 | # install python-enchant package. 391 | spelling-dict= 392 | 393 | # List of comma separated words that should not be checked. 394 | spelling-ignore-words= 395 | 396 | # List of comma separated words that should be considered directives if they 397 | # appear and the beginning of a comment and should not be checked. 398 | spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:,pragma:,# noinspection 399 | 400 | # A path to a file that contains private dictionary; one word per line. 401 | spelling-private-dict-file=.pyenchant_pylint_custom_dict.txt 402 | 403 | # Tells whether to store unknown words to indicated private dictionary in 404 | # --spelling-private-dict-file option instead of raising a message. 405 | spelling-store-unknown-words=no 406 | 407 | # Limits count of emitted suggestions for spelling mistakes. 408 | max-spelling-suggestions=2 409 | 410 | 411 | [DESIGN] 412 | 413 | # Maximum number of arguments for function / method 414 | max-args=10 415 | 416 | # Maximum number of locals for function / method body 417 | max-locals=25 418 | 419 | # Maximum number of return / yield for function / method body 420 | max-returns=11 421 | 422 | # Maximum number of branch for function / method body 423 | max-branches=27 424 | 425 | # Maximum number of statements in function / method body 426 | max-statements=100 427 | 428 | # Maximum number of parents for a class (see R0901). 429 | max-parents=7 430 | 431 | # List of qualified class names to ignore when counting class parents (see R0901). 432 | ignored-parents= 433 | 434 | # Maximum number of attributes for a class (see R0902). 435 | max-attributes=11 436 | 437 | # Minimum number of public methods for a class (see R0903). 438 | min-public-methods=2 439 | 440 | # Maximum number of public methods for a class (see R0904). 441 | max-public-methods=25 442 | 443 | # Maximum number of boolean expressions in an if statement (see R0916). 444 | max-bool-expr=5 445 | 446 | # List of regular expressions of class ancestor names to 447 | # ignore when counting public methods (see R0903). 448 | exclude-too-few-public-methods= 449 | 450 | max-complexity=10 451 | 452 | [CLASSES] 453 | 454 | # List of method names used to declare (i.e. assign) instance attributes. 455 | defining-attr-methods=__init__,__new__,setUp,__post_init__ 456 | 457 | # List of valid names for the first argument in a class method. 458 | valid-classmethod-first-arg=cls 459 | 460 | # List of valid names for the first argument in a metaclass class method. 461 | valid-metaclass-classmethod-first-arg=mcs 462 | 463 | # List of member names, which should be excluded from the protected access 464 | # warning. 465 | exclude-protected=_asdict,_fields,_replace,_source,_make 466 | 467 | # Warn about protected attribute access inside special methods 468 | check-protected-access-in-special-methods=no 469 | 470 | [IMPORTS] 471 | 472 | # List of modules that can be imported at any level, not just the top level 473 | # one. 474 | allow-any-import-level= 475 | 476 | # Allow wildcard imports from modules that define __all__. 477 | allow-wildcard-with-all=no 478 | 479 | # Analyse import fallback blocks. This can be used to support both Python 2 and 480 | # 3 compatible code, which means that the block might have code that exists 481 | # only in one or another interpreter, leading to false positives when analysed. 482 | analyse-fallback-blocks=no 483 | 484 | # Deprecated modules which should not be used, separated by a comma 485 | deprecated-modules=regsub,TERMIOS,Bastion,rexec 486 | 487 | # Create a graph of every (i.e. internal and external) dependencies in the 488 | # given file (report RP0402 must not be disabled) 489 | import-graph= 490 | 491 | # Create a graph of external dependencies in the given file (report RP0402 must 492 | # not be disabled) 493 | ext-import-graph= 494 | 495 | # Create a graph of internal dependencies in the given file (report RP0402 must 496 | # not be disabled) 497 | int-import-graph= 498 | 499 | # Force import order to recognize a module as part of the standard 500 | # compatibility libraries. 501 | known-standard-library= 502 | 503 | # Force import order to recognize a module as part of a third party library. 504 | known-third-party=enchant 505 | 506 | # Couples of modules and preferred modules, separated by a comma. 507 | preferred-modules= 508 | 509 | 510 | [EXCEPTIONS] 511 | 512 | # Exceptions that will emit a warning when being caught. Defaults to 513 | # "Exception" 514 | overgeneral-exceptions=builtins.Exception 515 | 516 | 517 | [TYPING] 518 | 519 | # Set to ``no`` if the app / library does **NOT** need to support runtime 520 | # introspection of type annotations. If you use type annotations 521 | # **exclusively** for type checking of an application, you're probably fine. 522 | # For libraries, evaluate if some users what to access the type hints at 523 | # runtime first, e.g., through ``typing.get_type_hints``. Applies to Python 524 | # versions 3.7 - 3.9 525 | runtime-typing = no 526 | 527 | 528 | [DEPRECATED_BUILTINS] 529 | 530 | # List of builtins function names that should not be used, separated by a comma 531 | bad-functions=map,input 532 | 533 | 534 | [REFACTORING] 535 | 536 | # Maximum number of nested blocks for function / method body 537 | max-nested-blocks=5 538 | 539 | # Complete name of functions that never returns. When checking for 540 | # inconsistent-return-statements if a never returning function is called then 541 | # it will be considered as an explicit return statement and no message will be 542 | # printed. 543 | never-returning-functions=sys.exit,argparse.parse_error 544 | 545 | 546 | [STRING] 547 | 548 | # This flag controls whether inconsistent-quotes generates a warning when the 549 | # character used as a quote delimiter is used inconsistently within a module. 550 | check-quote-consistency=no 551 | 552 | # This flag controls whether the implicit-str-concat should generate a warning 553 | # on implicit string concatenation in sequences defined over several lines. 554 | check-str-concat-over-line-jumps=no 555 | 556 | 557 | [CODE_STYLE] 558 | 559 | # Max line length for which to sill emit suggestions. Used to prevent optional 560 | # suggestions which would get split by a code formatter (e.g., black). Will 561 | # default to the setting for ``max-line-length``. 562 | max-line-length = 88 563 | 564 | --------------------------------------------------------------------------------