vintasoftware / django-react-boilerplate

Django 5, React, Bootstrap 5 with Python 3 and Webpack project boilerplate
MIT License
1.97k stars 479 forks source link

Add black #436

Closed vanessa closed 4 years ago

vanessa commented 4 years ago

Description

Note: Ignoring .py files in "Files changed" section removes the formatted files and cleans the diff a little bit, here's a shortcut

Motivation and Context

Closes #200

Steps to reproduce (if appropriate):

black

  1. Clone the project as a user following these steps
  2. After you compile and install requirements, check if black is installed by typing black
    • [ ] The output is No Path provided. Nothing to do 😴
  3. Install pre-commit hook with pre-commit install
  4. Create an example Python file inside backend folder
  5. Add the same file created previously inside a migrations folder (users/migrations for example)
  6. Try to commit the file you created (or run pre-commit)
    • [ ] pre-commit hook runs and formats the file
    • [ ] The limit of 100 characters per line is respected
    • [ ] The file in migrations folder wasn't touched

has_missing_migrations on pre-commit

  1. Run pre-commit
    • [ ] missing-migrations-local runs without problems

generated requirements files

  1. Try to commit when you finish following steps in black section
    • [ ] The generated requirements.txt and dev-requirements.txt isn't included

Types of changes

Checklist:

chocoelho commented 4 years ago

Please, merge isort.cfg with the following configuration as suggested by Black, remove the duplicates and make the suggestions by Black supersed ours.:

[settings]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
vanessa commented 4 years ago

@chocoelho Added them if you want to check :+1: