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

Reorder model field kwargs #8

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

UnknownPlatypus
Copy link
Owner

@UnknownPlatypus UnknownPlatypus commented Apr 7, 2024

This fixer standardizes the order of keyword arguments in Django model fields to improve readability and consistency.
By arranging arguments in a consistent order, the code becomes more predictable and making it simpler for developers to quickly identify key attributes in model definitions.

For now the fixer only format simple django fields. Support for ForeignKey/ManyToMany fiels is not available yet

-data_1 = models.CharField(default="", verbose_name="Donnée 1", blank=True, max_length=191)
-data_2 = models.CharField(blank=True, max_length=191, verbose_name="Donnée 2", default="")
-data_3 = models.CharField(max_length=191, verbose_name="Donnée 3", default="", blank=True)
+data_1 = models.CharField(verbose_name="Donnée 1", default="", blank=True, max_length=191)
+data_2 = models.CharField(verbose_name="Donnée 2", default="", blank=True, max_length=191)
+data_3 = models.CharField(verbose_name="Donnée 3", default="", blank=True, max_length=191)

@UnknownPlatypus UnknownPlatypus force-pushed the reorder-model-field-kwargs branch from 9e37060 to 85fd7c9 Compare April 7, 2024 22:14
@UnknownPlatypus UnknownPlatypus merged commit 2821467 into poc/additional-fixers Apr 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant