Code: Select all
class MyModel(models.Model):
roomName = models.CharField()
roomNumber = models.CharField()
< /code>
Das heißt, ich möchte, dass diese Erklärung von Git gezwungen wird, die folgende Syntax zu haben: < /p>
class MyModel(models.Model):
room_name = models.CharField()
room_number = models.CharField()
< /code>
Im Fall von Funktionen anstelle von: < /p>
def checkRules()...< /code>
Es wäre so etwas wie: < /p>
def check_rules()...
Ich habe das .pre-commit-config.yaml Aber ein schlechter Code ist weitergegeben, und wenn wir eine gute Praxis in Pre-Commit erzwingen können, wäre das großartig.
Code: Select all
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
args: ["--line-length", "120"]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies: []
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ['--order-by-type', "--profile", "black", "--filter-files"]
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]