Skip to content

Commit

Permalink
test: .pylintrc is applied with the default style
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Mar 9, 2021
1 parent b9c25e2 commit e306ec6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/nitpick/constants.py
Expand Up @@ -22,6 +22,7 @@
PRE_COMMIT_CONFIG_YAML = ".pre-commit-config.yaml"
EDITOR_CONFIG = ".editorconfig"
TOX_INI = "tox.ini"
PYLINTRC = ".pylintrc"

SINGLE_QUOTE = "'"
DOUBLE_QUOTE = '"'
Expand Down
39 changes: 36 additions & 3 deletions tests/test_ini.py
Expand Up @@ -4,7 +4,7 @@

from configupdater import ConfigUpdater

from nitpick.constants import EDITOR_CONFIG, SETUP_CFG, TOX_INI
from nitpick.constants import EDITOR_CONFIG, PYLINTRC, SETUP_CFG, TOX_INI
from nitpick.plugins.ini import IniPlugin, Violations
from nitpick.violations import Fuss, SharedViolations
from tests.helpers import XFAIL_ON_WINDOWS, ProjectMock
Expand Down Expand Up @@ -86,13 +86,46 @@ def test_default_style_is_applied(project_with_default_style):
[tox]
isolated_build = True
"""
expected_pylintrc = """
[BASIC]
bad-functions = map,filter
good-names = i,j,k,e,ex,Run,_,id,rv
[FORMAT]
indent-after-paren = 4
max-line-length = 120
max-module-lines = 1000
[MASTER]
jobs = 1
[REPORTS]
output-format = colorized
[SIMILARITIES]
ignore-comments = yes
ignore-docstrings = yes
ignore-imports = no
min-similarity-lines = 4
[VARIABLES]
dummy-variables-rgx = _$|dummy
"""
project_with_default_style.api_check_then_apply(
Fuss(True, SETUP_CFG, 321, " was not found. Create it with this content:", expected_setup_cfg),
Fuss(True, EDITOR_CONFIG, 321, " was not found. Create it with this content:", expected_editor_config),
Fuss(True, TOX_INI, 321, " was not found. Create it with this content:", expected_tox_ini),
partial_names=[SETUP_CFG, EDITOR_CONFIG, TOX_INI],
Fuss(True, PYLINTRC, 321, " was not found. Create it with this content:", expected_pylintrc),
partial_names=[SETUP_CFG, EDITOR_CONFIG, TOX_INI, PYLINTRC],
).assert_file_contents(
SETUP_CFG, expected_setup_cfg, EDITOR_CONFIG, expected_editor_config, TOX_INI, expected_tox_ini
SETUP_CFG,
expected_setup_cfg,
EDITOR_CONFIG,
expected_editor_config,
TOX_INI,
expected_tox_ini,
PYLINTRC,
expected_pylintrc,
)


Expand Down

0 comments on commit e306ec6

Please sign in to comment.