Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements focused on modernizing the codebase, enhancing static analysis, and updating CI/CD workflows. The most significant changes include raising the minimum supported Python version to 3.9, adopting modern type hint syntax, adding strict and relaxed linter configurations, and updating workflows to test newer Python versions. Additionally, the code has been refactored to improve maintainability and eliminate linter warnings.
Python version and type hint modernization:
from __future__ import annotationsand PEP 604 union syntax (e.g.,X | Y), replacingtypingimports with built-in types throughoutpfsense_redactor/redactor.py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Linter and security configuration:
.pylintrc(strict for production code),.pylintrc-tests(relaxed for test code), and.bandit(security linting) configuration files for consistent static analysis. [1] [2] [3]CI/CD workflow updates:
update-snapshots.yml, to automate updating of reference test snapshots.Documentation:
CHANGELOG.mdto reflect all major changes, including Python version bump, type hint modernization, linter/security config additions, and CI updates. [1] [2]Code maintainability and bug fixes:
pfsense_redactor/redactor.pyfor clarity and maintainability by breaking out category-specific masking into dedicated methods. [1] [2]ET.indent()try/except block) now that Python 3.9+ is required.These changes collectively modernize the project, improve developer experience, and ensure robust static analysis across both production and test code.