Auto format the code + update the readme with the new project template#2
Draft
John15321 wants to merge 2 commits into
Draft
Auto format the code + update the readme with the new project template#2John15321 wants to merge 2 commits into
John15321 wants to merge 2 commits into
Conversation
Signed-off-by: Jan Bronicki <janbronicki@gmail.com>
| return False | ||
| return "bugs.gentoo.org" in text or "glsa.gentoo.org" in text or "security.gentoo.org/glsa" in text | ||
| return ( | ||
| "bugs.gentoo.org" in text |
| return "bugs.gentoo.org" in text or "glsa.gentoo.org" in text or "security.gentoo.org/glsa" in text | ||
| return ( | ||
| "bugs.gentoo.org" in text | ||
| or "glsa.gentoo.org" in text |
| without_scripts = re.sub(r"<script\b[^>]*>.*?</script>", " ", text, flags=re.IGNORECASE | re.DOTALL) | ||
| without_styles = re.sub(r"<style\b[^>]*>.*?</style>", " ", without_scripts, flags=re.IGNORECASE | re.DOTALL) | ||
| without_scripts = re.sub( | ||
| r"<script\b[^>]*>.*?</script>", " ", text, flags=re.IGNORECASE | re.DOTALL |
There was a problem hiding this comment.
Pull request overview
This pull request primarily applies automated formatting across the Python codebase and updates the README to reflect the current project template and recommended developer workflow (uv + Makefile). It also standardizes UTC handling by switching several modules from timezone.utc to datetime.UTC (consistent with the project’s Python >=3.12 requirement).
Changes:
- Reformat code and tests (line wrapping, import grouping, dict/list formatting) to match the formatter’s output.
- Update README with uv/Makefile-based installation, development, and CI workflow documentation.
- Normalize UTC usage in a few modules by using
datetime.UTC.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_xml_security.py | Formatting-only changes to improve readability of a long call. |
| tests/test_workflows.py | Formatting-only changes (line wrapping for long expressions and asserts). |
| tests/test_sources_models.py | Formatting-only changes; preserves existing test intent while wrapping long calls/asserts. |
| tests/test_rustsec.py | Formatting-only changes (blank lines removed, long assert wrapped, dict formatting). |
| tests/test_rules.py | Formatting-only changes (wrap long expected lists and call args). |
| tests/test_prompt_hardening.py | Formatting-only changes (wrap long asserts and string concatenation). |
| tests/test_oss_security.py | Formatting-only changes (line wrapping, whitespace cleanup). |
| tests/test_issues_sbom.py | Formatting-only changes (import grouping, wrapped calls/asserts). |
| tests/test_http_security.py | Formatting-only changes (import grouping, small expression simplification, wrapped signature). |
| tests/test_go_vulndb.py | Formatting-only changes (dict literals and list formatting). |
| tests/test_field_injection.py | Formatting-only changes (inline constant string, wrapped comprehensions). |
| tests/test_env.py | Formatting-only changes (string literal quoting). |
| tests/test_cli.py | Formatting-only changes (wrap parser arg lists and asserts). |
| tests/test_actions.py | Formatting-only changes (wrap constructor call). |
| src/security_triage/time_utils.py | Switch to datetime.UTC and reformat function signatures/blocks. |
| src/security_triage/sources.py | Formatting-only changes; preserves existing source fetching/filtering logic. |
| src/security_triage/sbom.py | Formatting-only changes; minor type annotation modernization consistent with from __future__ import annotations. |
| src/security_triage/rustsec.py | Formatting-only changes (line wrapping and small conditional formatting). |
| src/security_triage/rules.py | Formatting-only changes; some long expressions made multi-line for clarity. |
| src/security_triage/reporting.py | Formatting-only changes (wrapping list construction and long f-strings). |
| src/security_triage/reasoning.py | Formatting-only changes (wrap list comprehension). |
| src/security_triage/prompt_cache.py | Formatting-only changes (wrap json encoding and method signature). |
| src/security_triage/oss_security.py | Switch to datetime.UTC and formatting-only changes. |
| src/security_triage/models.py | Formatting-only changes (wrapping long log calls/conditions and helper logic). |
| src/security_triage/issues.py | Formatting-only changes (import grouping, wrapped calls and regex definition). |
| src/security_triage/issue_updates.py | Formatting-only changes (wrap long conditions/sets). |
| src/security_triage/io_utils.py | Formatting-only changes (wrap exception messages and json writes). |
| src/security_triage/http_utils.py | Formatting-only changes (wrap signatures and long error messages). |
| src/security_triage/go_vulndb.py | Formatting-only changes (wrap complex calls and dict coercions). |
| src/security_triage/env.py | Formatting-only changes (wrap long loops and conditionals). |
| src/security_triage/discovery.py | Formatting-only changes (import grouping, wrapped logs/calls, small readability tweaks). |
| src/security_triage/debug.py | Switch to datetime.UTC and formatting-only changes. |
| src/security_triage/console.py | Switch to datetime.UTC and formatting-only changes. |
| src/security_triage/cli.py | Formatting-only changes (wrap argparse definitions and model wiring). |
| src/security_triage/cleanup.py | Formatting-only changes (wrap logging, calls, and return tuples). |
| src/security_triage/actions.py | Formatting-only changes (wrap signatures, structured dict literals). |
| README.md | Update documentation to the uv/Makefile project template and include CI/release workflow notes. |
… for improved code quality and readability Signed-off-by: Jan Bronicki <janbronicki@gmail.com>
Comment on lines
50
to
+52
| def read(self, amount=None): | ||
| # Return more than the caller asked for to simulate a huge body. | ||
| return b"x" * ((amount or 0)) | ||
| return b"x" * (amount or 0) |
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.
Signed-off-by: Jan Bronicki janbronicki@gmail.com