Skip to content

Refactor code formatting, templates, and remove unused configurations - #40

Merged
Ajimaru merged 2 commits into
devfrom
chore/pre-commit-hooks
Dec 2, 2026
Merged

Ajimaru merged 2 commits into
devfrom
chore/pre-commit-hooks

Conversation

@Ajimaru

@Ajimaru Ajimaru commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Description

This pull request introduces a standardized, modern code style and linting setup across the project, replacing legacy and inconsistent tooling with a unified pre-commit-based workflow. It removes older configuration files, adds shared configuration for tools like Ruff, isort, Prettier, and DjLint, and updates CI and documentation to match the new approach. Several minor code cleanups and formatting improvements are also included.

Tooling and Linting Overhaul

  • Added .pre-commit-config.yaml to define a consistent set of linting and formatting hooks (Ruff, isort, Prettier, DjLint, ShellCheck, etc.) and .pre-commit as the primary lint runner for both local development and CI.
  • Removed legacy linting configuration files: .flake8 and eslint.config.mjs, and removed references to these in .codacy.yml. [1] [2] [3]
  • Added and configured shared settings for isort (.isort.cfg), Prettier (.prettierrc.yaml, .prettierignore), and DjLint (.djlintrc). [1] [2] [3] [4]

CI and Documentation Updates

  • Updated GitHub Actions workflow to use pre-commit as the linting step, removing Node.js and ShellCheck setup, and simplified the lint job. [1] [2] [3]
  • Updated README.md to instruct contributors to use pre-commit for linting/formatting and updated code style badges to reflect the new tooling (Ruff replaces Black, removed Pylint/Bandit badges). [1] [2]

Formatting and Code Cleanups

  • Applied minor formatting improvements and line-wrapping cleanups throughout octoprint_logmonitor/__init__.py for consistency and readability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
  • Removed Python-specific line length override from .editorconfig to match new standards.

Related Issues

Type of Change

  • Bugfix
  • Feature
  • Docs
  • Refactor
  • Security

Checklist

  • Description of change
  • Related issue(s)
  • Tests added / updated
  • Documentation updated

- Adjusted HTML templates in logmonitor_settings.jinja2 and logmonitor_tab.jinja2 for better readability and consistency.
- Updated indentation and line breaks in various sections to enhance code clarity.
- Removed unnecessary settings from pyproject.toml and migrated Ruff configuration to ruff.toml.
- Simplified the installation of fake OctoPrint plugins in tests/conftest.py.
- Improved test cases for JavaScript extraction and integration API, ensuring better error handling and readability.
- Refined log parsing tests to streamline assertions and enhance clarity.
- Enhanced test structure in test_log_tailer.py and test_plugin_core.py for better maintainability.
- General code cleanup across multiple test files to adhere to PEP 8 standards.
@Ajimaru Ajimaru self-assigned this Dec 2, 2026
@Ajimaru Ajimaru added ci CI, build or workflow changes chore Maintenance work with no user-facing change labels Dec 2, 2026
@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e8028178-d9cb-4a76-94a5-b69c251a87d3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Ajimaru

Ajimaru commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production

codacy-production Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage 77.59% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ 77.59% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (5954e2c) 1259 1037 82.37%
Head commit (ae61d8b) 1259 (+0) 1037 (+0) 82.37% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#40) 58 45 77.59%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment thread tests/test_log_searcher.py Dismissed
@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.58621% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
octoprint_logmonitor/__init__.py 74.46% 12 Missing ⚠️
octoprint_logmonitor/log_tailer.py 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Ajimaru
Ajimaru merged commit 7e307cc into dev Dec 2, 2026
29 checks passed
@Ajimaru
Ajimaru deleted the chore/pre-commit-hooks branch December 2, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance work with no user-facing change ci CI, build or workflow changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants