Skip to content
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

Strange behaviour with wemake-python-styleguide #71

Closed
sobolevn opened this issue Aug 12, 2019 · 3 comments
Closed

Strange behaviour with wemake-python-styleguide #71

sobolevn opened this issue Aug 12, 2019 · 3 comments
Labels
bug Something isn't working released Feature/fix is released

Comments

@sobolevn
Copy link

Your bug may already be reported!
Please search on the issue tracker before creating one.

Expected Behavior

That's what I do:

  1. Clone https://github.com/wemake-services/wemake-python-styleguide
  2. poetry install
  3. poetry add --dev nitpick
  4. Then I add this configuration to nitpick-style.toml:
# Default style file for nitpick
# https://raw.githubusercontent.com/andreoliwa/nitpick/v0.18.0/nitpick-style.toml

[nitpick]
minimum_version = "0.10.0"

["setup.cfg".flake8]
enable-extensions = "G"
  1. When I run flake8 . that's what I get:
» flake8 .

./tests/test_version.py

  1:1      NIP312 File pyproject.toml should be deleted
  # -*- coding: utf-8 -*-
  ^

Full list of violations and explanations:
https://wemake-python-stylegui.de/en/0.11.1/pages/usage/violations/

I am not sure why I should delete my pyproject.toml 🙂

@sobolevn sobolevn added the bug Something isn't working label Aug 12, 2019
@andreoliwa
Copy link
Owner

andreoliwa commented Aug 12, 2019

Hi @sobolevn.

If you don't have anything related to pyproject.toml in your style, then Nitpick assumes you should delete the file.

It's just a bad default... I realise it now. 😬
Files should be deleted only if explicitly set in the style.
I will change this behaviour.

For now, ignore NIP312 on flake8 and it should work.

Or try adding some rule for pyproject.toml to your style, like this:

["pyproject.toml".tool.black]
line-length = 120

Thanks!

@sobolevn
Copy link
Author

@andreoliwa awesome! Thanks for your explanation!

andreoliwa pushed a commit that referenced this issue Aug 13, 2019
# [0.19.0](v0.18.0...v0.19.0) (2019-08-13)

### Bug Fixes

* emit warning when TOML is invalid in a style file (closes [#68](#68)) ([b48e0a4](b48e0a4))
* files should not be deleted unless explicitly set in the style ([b5953ff](b5953ff)), closes [#71](#71)
* improve the way to find the root dir of the project ([fa3460a](fa3460a)), closes [#72](#72)

### Features

* validate the merged style file schema ([1e31d0a](1e31d0a)), closes [#69](#69)
@andreoliwa
Copy link
Owner

🎉 This issue has been resolved in version 0.19.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@andreoliwa andreoliwa added the released Feature/fix is released label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Feature/fix is released
Projects
None yet
Development

No branches or pull requests

2 participants