andreoliwa/nitpick

View on GitHub
docs/ideas/ini.toml

Summary

Maintainability
Test Coverage
# Keys should be present
# [Enforce presence of keys (with any values) · Issue #218 · andreoliwa/nitpick](https://github.com/andreoliwa/nitpick/issues/218)
["setup.cfg".flake8]
ignore__exists = "str"
max-line-length__exists = "int"
exclude__exists = "str"
max-complexity__exists = "int"
inline-quotes__exists = "str"

# https://github.com/andreoliwa/nitpick/issues/271
ignore__separators = ","
exclude__separators = ","

# Keys should be absent
["setup.cfg".some-section]
ignore__exists = true
max-line-length__exists = true
exclude__exists = true
max-complexity__exists = true
inline-quotes__exists = true

# Section should be absent
["setup.cfg".darglint]
__exists = false
blabla = "{{ nit.section_absent() }}"

# Section should be absent
["setup.cfg"."tox:tox"]
__exists = false
["setup.cfg"."gh-actions"]
__exists = false

# Section should be present
["tox.ini"."tox"]
__exists = true
["tox.ini".gh-actions]
__exists = true

# Keys should be present using Jinja
["setup.cfg".flake8-jinja]
ignore = "{{ nit.present(str, validators=[comma_separated_str]) }}"
max-line-length = "{{ nit.present(int, validators=[range(80, 120)]) }}"
exclude = "{{ nit.present(str, validators=[comma_separated_str]) }}"
max-complexity = "{{ nit.present(int) }}"
inline-quotes = "{{ nit.present(str, choices=['double', 'single']) }}"

["setup.cfg".isort]
# https://github.com/andreoliwa/nitpick/issues/271
skip__separators = ","
known_first_party__separators = ","

["tox.ini".pytest]
# https://github.com/andreoliwa/nitpick/issues/271
addopts__separators = " "
norecursedirs__separators = " "
testpaths__separators = " \n"