Skip to content

Conversation

@semanticintent
Copy link
Owner

  • Add filter_by_status_class() to cloudflare.py with clear docstring
  • Replace inline lambda in cf_errors command with the new function
  • Add test for filter_by_status_class behavior
  • Improves code readability and documents the status class matching logic

The function matches entire HTTP status classes by first digit:

  • '502' matches all 5xx (500, 502, 503, etc.)
  • '404' matches all 4xx (400, 401, 404, etc.)

Description

Brief description of what this PR does.

Related Issues

Fixes #(issue number)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • New parser (adds support for a new log format)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • My code follows the project's style guidelines
  • I have tested my changes locally
  • I have added tests for new functionality
  • All tests pass (pytest tests/ -v)
  • I have updated documentation if needed
  • My changes work on Windows (or I've noted platform limitations)

Testing

Describe how you tested your changes:

# Commands you ran to test

Screenshots (if applicable)

Add screenshots of CLI output if relevant.

Additional Notes

Any other information reviewers should know.

- Add filter_by_status_class() to cloudflare.py with clear docstring
- Replace inline lambda in cf_errors command with the new function
- Add test for filter_by_status_class behavior
- Improves code readability and documents the status class matching logic

The function matches entire HTTP status classes by first digit:
- '502' matches all 5xx (500, 502, 503, etc.)
- '404' matches all 4xx (400, 401, 404, etc.)
@semanticintent semanticintent merged commit 6c809d3 into main Jan 4, 2026
15 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.

3 participants