Skip to content

Refactor templates and update linting configurations - #130

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

Pull Request

  • What does this change do?

This pull request introduces a standardized, modernized linting and formatting setup across the codebase, replacing legacy tools (Black, Flake8) with a unified pre-commit-based workflow using Ruff, isort, djLint, Prettier, and additional quality checks. It updates configuration files, documentation, and CI workflows to reflect these changes, and removes obsolete configs and scripts. Minor code cleanups and formatting tweaks are also included.

Tooling and Linting Modernization:

  • Added .pre-commit-config.yaml to define a consistent set of pre-commit hooks (Ruff, isort, djLint, Prettier, codespell, ShellCheck, lessc) for code quality and formatting checks across Python, templates, JS, LESS, JSON, and YAML.
  • Removed legacy linting/formatting configs: deleted .flake8 and eslint.config.js, and removed references to Black and Flake8 in documentation and configs. [1] [2] [3] [4] [5] [6]
  • Added and updated config files for new tools: .isort.cfg (isort), .djlintrc (djLint), .prettierrc.yaml and .prettierignore (Prettier), with shared settings for all plugin repos. [1] [2] [3] [4]

CI and Workflow Updates:

  • Updated .github/workflows/ci.yml to use pre-commit for linting in CI, removed node and ShellCheck setup steps, and adjusted caching and environment variables for the new workflow. [1] [2] [3]

Documentation Updates:

  • Updated README.md, CONTRIBUTING.md, and docs to reference Ruff and the new pre-commit-based workflow, removing mentions of Black and Flake8 and describing the new process for running checks and formatting code. [1] [2] [3] [4] [5] [6]

Codebase Cleanups and Formatting:

  • Applied minor formatting improvements and deduplicated code in octoprint_temp_eta/__init__.py (e.g., single-line assignments, improved logger calls, removed flake8 comments). [1] [2] [3] [4] [5] [6] [7]

Other Configuration Updates:

  • Updated .editorconfig and .codacy.yml to match new standards (e.g., line length, exclude paths). [1] [2]

These changes collectively ensure a more maintainable, consistent, and automated code quality process across the project.

Checklist

  • Public-facing text is in English
  • Tests pass (pytest)
  • Lint/formatting passes (pre-commit run --all-files)
  • Docs updated (if needed)
  • Workflow changes (if any) keep least-privilege permissions: and avoid pull_request_target unless strictly necessary

- Adjusted indentation and formatting in various Jinja2 template files to enhance clarity.
- Updated the `pyproject.toml` to simplify development dependencies.
- Introduced a new `ruff.toml` configuration file for linting settings.
- Cleaned up test files by removing unnecessary comments and improving code style.
- Added a README for translations to guide users on managing locale catalogs.
@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
Contributor

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: 5c54e426-19d2-4ed7-813f-0ed3c3744064

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)
✅ Open Source Security 0 0 0 0 0 issues
✅ 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

Not up to standards ⛔

🔴 Issues 10 minor

Alerts:
⚠ 10 issues (≤ 0 issues of at least minor severity)

Results:
10 new issues

Category Results
CodeStyle 10 minor

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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

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

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d9a641d) 1848 1747 94.53%
Head commit (fbf5bba) 1848 (+0) 1747 (+0) 94.53% (+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 (#130) 16 16 100.00%

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.

@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Ajimaru
Ajimaru merged commit 9c277f9 into dev Dec 2, 2026
26 of 27 checks passed
@Ajimaru
Ajimaru deleted the chore/pre-commit-hooks branch December 2, 2026 12:27
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.

1 participant