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

feat: suggest styles based on the file types in the project #629

Merged
merged 58 commits into from
Nov 20, 2023

Conversation

andreoliwa
Copy link
Owner

@andreoliwa andreoliwa commented Nov 11, 2023

Issues fixed by this pull request:

Proposed changes

  1. Option --suggest on nitpick init, to scan project files and suggest styles based on file type (extension).
  2. Option --fix to edit files in place.
  3. New pre-commit hook nitpick-suggest.
  4. Use the built-in styles by default but allow you to choose a custom directory with --library.
  5. The names of options and TOML keys suggested in nitpick init: Identify styles that are relevant for your project and programming language #331 were slightly modified; check the docs in this pull request.

Checklist

  • Read the contribution guidelines
  • Run make locally before pushing commits
  • Add tests for the relevant parts:
    • API
    • CLI
    • flake8 plugin (normal mode)
    • flake8 plugin (offline mode)
  • Write documentation when there's a new API or functionality

@coveralls
Copy link

coveralls commented Nov 11, 2023

Pull Request Test Coverage Report for Build 6845131875

  • 208 of 212 (98.11%) changed or added relevant lines in 6 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.1%) to 95.981%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/nitpick/cli.py 50 54 92.59%
Files with Coverage Reduction New Missed Lines %
src/nitpick/cli.py 1 88.89%
src/nitpick/style.py 2 91.82%
Totals Coverage Status
Change from base Build 6840572461: -0.1%
Covered Lines: 2088
Relevant Lines: 2155

💛 - Coveralls

@andreoliwa andreoliwa marked this pull request as ready for review November 20, 2023 00:22
@andreoliwa andreoliwa self-assigned this Nov 20, 2023
@andreoliwa andreoliwa merged commit e2bca24 into develop Nov 20, 2023
29 checks passed
@andreoliwa andreoliwa deleted the init-suggest branch November 20, 2023 21:25
github-actions bot pushed a commit that referenced this pull request Dec 31, 2023
# [0.35.0](v0.34.0...v0.35.0) (2023-12-31)

### Bug Fixes

* **deps:** update dependency click to v8.1.7 ([783741d](783741d))
* fail when no style is explicitly configured (don't use the default style) ([#606](#606)) ([f309354](f309354))
* **style:** better .editorconfig ([0b779d9](0b779d9))
* **style:** comma_separated_values for flake8/isort ([7336dbc](7336dbc))
* **style:** move "build" to readthedocs.toml ([676ac24](676ac24))
* **style:** remove Radon from the Nitpick preset ([126b1c1](126b1c1))
* **style:** tag markdownlint.toml as a markdown style ([578bfb5](578bfb5))
* **style:** use black mirror that's 2x faster ([67dc163](67dc163))

### Features

* add Python 3.12 ([#616](#616)) ([90ced4c](90ced4c))
* set CLI options with environment variables ([3575b9a](3575b9a))
* **style:** add toml-sort ([#626](#626)) ([a4aeef7](a4aeef7))
* **style:** default Python version on pre-commit ([3557c1f](3557c1f))
* **style:** Poetry (virtualenv in project) ([f002b8b](f002b8b))
* suggest styles based on the file types in the project ([#629](#629)) ([e2bca24](e2bca24))
Copy link

🎉 This PR is included in version 0.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Feature/fix is released label Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Feature/fix is released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nitpick init: Identify styles that are relevant for your project and programming language
2 participants