New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file warning #280

Merged
merged 8 commits into from Sep 3, 2017

Conversation

Projects
None yet
2 participants
@shacharoo
Copy link
Member

shacharoo commented Sep 3, 2017

Thanks for submitting a PR!

Please make sure to check for the following items:

  • Add unit tests and integration tests where applicable.
    If you've added a error code or changed an error code behavior,
    you should probably add or change a test case file under tests/test_cases/ and add
    it to the list under tests/test_definitions.py.
    If you've added or changed a command line option,
    you should probably add or change a test in tests/test_integration.py.
  • Add a line to the release notes (docs/release_notes.rst) under "Current Development Version".
    Make sure to include the PR number after you open and get one.

Please don't get discouraged as it may take a while to get a review.

@shacharoo shacharoo requested a review from Nurdok Sep 3, 2017

if options is None:
log.warning('Configuration file does not contain a '
'pydocstyle section. Using default configuration.')
config = self._create_check_config(self._options)

This comment has been minimized.

@Nurdok

Nurdok Sep 3, 2017

Member

This function is called for every directory in a project, so a lack of a pydocstyle section should generally be treated by just skipping it and checking the parent directory. If you use the default config, you might screw up the configuration (this might happen if, for example, there's a setup.cfg file for a different tool).

This logic should only be applied if self._run_config.config is not None, i.e., if a specific config file is specified.

This comment has been minimized.

@Nurdok

Nurdok Sep 3, 2017

Member

Sorry, I thought this block was in the top level of the method, but in fact it's inside the self._run_config.config check. But add a test for this anyway (a config file in the hierarchy that doesn't have a correct section name).

This comment has been minimized.

@shacharoo
if options is None:
log.warning('Configuration file does not contain a '
'pydocstyle section. Using default configuration.')
config = self._create_check_config(self._options)

This comment has been minimized.

@Nurdok

Nurdok Sep 3, 2017

Member

Sorry, I thought this block was in the top level of the method, but in fact it's inside the self._run_config.config check. But add a test for this anyway (a config file in the hierarchy that doesn't have a correct section name).

shacharoo added some commits Sep 3, 2017

@Nurdok

Nurdok approved these changes Sep 3, 2017

@Nurdok Nurdok merged commit 7654dde into PyCQA:master Sep 3, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@shacharoo shacharoo deleted the shacharoo:config-file-warning branch Sep 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment