Skip to content

Add db_default checks#26

Merged
justmobilize merged 1 commit intomainfrom
add_db_default_checks
Dec 11, 2025
Merged

Add db_default checks#26
justmobilize merged 1 commit intomainfrom
add_db_default_checks

Conversation

@justmobilize
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread tests/test_rou_109.py
field=models.TextField(blank=True, null=True),
)
]""" # noqa ROU102
]"""
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why it yelled before, but these aren't needed

Comment thread flake8_routable.py
"def",
)

MAX_BLANK_LINES_AFTER_COMMENT = 2
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorted

Comment thread flake8_routable.py
UNDEFINED = object()


class LintClass:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the goal is to move all of them to a self contained class, do the main class doesn't balloon

Comment thread flake8_routable.py
version = importlib_metadata.version(__name__)

def __init__(self, tree, file_tokens: list[tokenize.TokenInfo]) -> None:
def __init__(self, tree, file_tokens: list[tokenize.TokenInfo], filename: str) -> None:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added filename, so a rule can ignore certain files

Comment thread flake8_routable.py
raise NotImplementedError()


class ModelFieldDefinitions(LintClass):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the new one

Comment thread flake8_routable.py

class ModelFieldDefinitions(LintClass):

SWAP_VALUES = {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for cases where the db_default isn't the same code wise, but does the same thing

@justmobilize justmobilize marked this pull request as ready for review December 10, 2025 21:17
@justmobilize justmobilize merged commit 2de8c51 into main Dec 11, 2025
1 check passed
@justmobilize justmobilize deleted the add_db_default_checks branch December 11, 2025 17:05
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.

3 participants