Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ exclude_paths:
- "**/vendor/**"
- "**/*.min.js"
- "**/*.min.css"
- "eslint.config.mjs"
- "**/*.css"

# Codacy's server-side Stylelint profile reports broken "scss_*" rules and
Expand Down
6 changes: 6 additions & 0 deletions .djlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"profile": "jinja",
"ignore": "H005,H007,H013,H019,H020,H021,H023,H026,H030,H036,H043,H047,H050,J018,T002",
"max_blank_lines": 1,
"use_gitignore": true
}
5 changes: 0 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 90

# Python stays at 88 (black/isort default) until the linters move to 90 too;
# isort reads this value.
[*.py]
max_line_length = 88

[*.{yml,yaml,json,less,md}]
indent_size = 2

Expand Down
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

53 changes: 15 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
TEST_DEPS: "-e .[develop]"
TEST_PATH: ""
# "pre-commit" once the repo has a hook config, else "ruff" with RUFF_ARGS.
LINT: ruff
LINT: pre-commit
RUFF_ARGS: ""
# setup.py imports octoprint_setuptools, so those builds need OctoPrint installed.
BUILD_ARGS: ""
Expand All @@ -36,26 +36,6 @@ jobs:
with:
python-version: "3.13"

# Hooks with `language: system` need the node packages and ShellCheck 0.11.
- name: Set up Node.js
if: env.LINT == 'pre-commit' && hashFiles('package.json') != ''
uses: actions/setup-node@v7
with:
node-version: "22"

- name: Install node packages
if: env.LINT == 'pre-commit' && hashFiles('package.json') != ''
run: |
if [ -f package-lock.json ]; then npm ci --no-audit --no-fund
else npm install --no-audit --no-fund; fi

- name: Install ShellCheck
if: env.LINT == 'pre-commit' && hashFiles('.githooks/shellcheck-hook.sh') != ''
run: |
url=https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.x86_64.tar.xz
curl -fsSL "$url" | tar -xJ -C "$RUNNER_TEMP"
sudo install "$RUNNER_TEMP/shellcheck-v0.11.0/shellcheck" /usr/local/bin/shellcheck

- name: Cache pre-commit hook environments
if: env.LINT == 'pre-commit'
uses: actions/cache@v6
Expand All @@ -65,9 +45,6 @@ jobs:

- name: Run pre-commit
if: env.LINT == 'pre-commit'
# The translations hook needs a local venv; the Translations job covers it.
env:
SKIP: check-translations
run: |
python -m pip install pre-commit
pre-commit run --all-files --show-diff-on-failure
Expand All @@ -88,18 +65,18 @@ jobs:
matrix:
include:
# Every Python version each OctoPrint generation supports.
- { octoprint: "1.x", python: "3.9", runner: ubuntu-24.04 }
- { octoprint: "1.x", python: "3.10", runner: ubuntu-latest }
- { octoprint: "1.x", python: "3.11", runner: ubuntu-latest }
- { octoprint: "1.x", python: "3.12", runner: ubuntu-latest }
- { octoprint: "1.x", python: "3.13", runner: ubuntu-latest }
- { octoprint: "2.x", python: "3.9", runner: ubuntu-24.04 }
- { octoprint: "2.x", python: "3.10", runner: ubuntu-latest }
- { octoprint: "2.x", python: "3.11", runner: ubuntu-latest }
- { octoprint: "2.x", python: "3.12", runner: ubuntu-latest }
- { octoprint: "2.x", python: "3.13", runner: ubuntu-latest, coverage: true }
- { octoprint: "2.x", python: "3.14", runner: ubuntu-latest }
- { octoprint: "2.x", python: "3.15", runner: ubuntu-latest }
- {octoprint: "1.x", python: "3.9", runner: ubuntu-24.04}
- {octoprint: "1.x", python: "3.10", runner: ubuntu-latest}
- {octoprint: "1.x", python: "3.11", runner: ubuntu-latest}
- {octoprint: "1.x", python: "3.12", runner: ubuntu-latest}
- {octoprint: "1.x", python: "3.13", runner: ubuntu-latest}
- {octoprint: "2.x", python: "3.9", runner: ubuntu-24.04}
- {octoprint: "2.x", python: "3.10", runner: ubuntu-latest}
- {octoprint: "2.x", python: "3.11", runner: ubuntu-latest}
- {octoprint: "2.x", python: "3.12", runner: ubuntu-latest}
- {octoprint: "2.x", python: "3.13", runner: ubuntu-latest, coverage: true}
- {octoprint: "2.x", python: "3.14", runner: ubuntu-latest}
- {octoprint: "2.x", python: "3.15", runner: ubuntu-latest}
env:
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
steps:
Expand Down Expand Up @@ -159,8 +136,8 @@ jobs:
fail-fast: false
matrix:
include:
- { octoprint: "1.x", python: "3.9", runner: ubuntu-24.04, disabled: false }
- { octoprint: "2.x", python: "3.13", runner: ubuntu-latest, disabled: false }
- {octoprint: "1.x", python: "3.9", runner: ubuntu-24.04, disabled: false}
- {octoprint: "2.x", python: "3.13", runner: ubuntu-latest, disabled: false}
steps:
- uses: actions/checkout@v7

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ Thumbs.db
.venv/
venv/
env/
.logs/
.coverage
.cache/
.githooks/
.pre-commit-config.yaml
.octoprint-*/

# Local-only lint config
Expand Down
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Import order shared by all plugin repos; compatible with ruff format.
[settings]
profile = black
line_length = 90
extend_skip_glob = **/vendor/*,3rdPartySoftware/*,archive/*
48 changes: 48 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Same hooks in every plugin repo, following OctoPrint core's setup.
# Set up once with `pre-commit install`; CI runs them on every push.
exclude: (^|/)(translations|vendor)/|^(docs|scripts|archive|3rdPartySoftware)/|\.(css|svg|map|gcode)$|\.min\.js$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: check-json
- id: check-yaml
# mkdocs.yml uses custom tags; only the syntax is checked.
args: [--unsafe]
- id: check-toml
- id: check-merge-conflict
- repo: https://github.com/PyCQA/isort
rev: 9.0.2
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.6
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: https://github.com/djlint/djlint
rev: v1.54.2
hooks:
- id: djlint-reformat-jinja
- id: djlint-jinja
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.10.1
hooks:
- id: prettier
files: \.(js|json|less|ya?ml)$
- repo: https://github.com/codespell-project/codespell
rev: v2.4.3
hooks:
- id: codespell
# Identifiers, config keys and product names, not typos.
args:
- --ignore-words-list
- commitish,offsetp,colorfull,basf,paht,sme,unparseable,pre-selected
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1-1
hooks:
- id: shellcheck
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Same scope as the prettier hook in .pre-commit-config.yaml.
*.md
*.css
*.min.js
**/package.json
**/package-lock.json
**/translations/
**/vendor/
docs/
scripts/
archive/
3rdPartySoftware/
12 changes: 12 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Prettier settings shared by all plugin repos, taken from OctoPrint core.
printWidth: 90
tabWidth: 4
semi: true
trailingComma: "none"
singleQuote: false
quoteProps: consistent
bracketSpacing: false
overrides:
- files: ["*.yaml", "*.yml", "*.json", "*.less"]
options:
tabWidth: 2
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ When a log entry matches configured trigger severities (default: WARNING/ERROR/C
git clone https://github.com/Ajimaru/OctoPrint-LogMonitor.git
cd OctoPrint-LogMonitor
python -m venv .venv && source .venv/bin/activate
python -m pip install -e .[develop]
python -m pip install -e .[develop] pre-commit
pre-commit install

# Run the test suite
python -m pytest

# Lint / format
python -m flake8 octoprint_logmonitor tests
python -m black octoprint_logmonitor tests
# Lint / format (the same hooks CI runs)
pre-commit run --all-files
```

The plugin API used by the frontend is documented in the [REST API reference](https://ajimaru.github.io/OctoPrint-LogMonitor/rest-api/).
Expand Down Expand Up @@ -194,14 +194,12 @@ Summary: this project exposes many status and quality badges (CI, linting, cover

### 🧪 2. Code Quality & Formatting

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000?style=flat-square&logo=black&logoColor=white)](https://github.com/psf/black)
[![Code style: Ruff](https://img.shields.io/badge/code%20style-ruff-261230?style=flat-square&logo=ruff&logoColor=D7FF64)](https://github.com/astral-sh/ruff)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat-square&labelColor=ef8336&logo=python&logoColor=white)](https://pycqa.github.io/isort/)
[![Code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4?style=flat-square&logo=prettier&logoColor=white)](https://github.com/prettier/prettier)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?style=flat-square&logo=pre-commit&logoColor=white)](https://pre-commit.com/)
[![Codacy Badge](https://img.shields.io/codacy/grade/1b946ed41ef2479fa1eb254e6eea9fb0?style=flat-square&logo=codacy&logoColor=white)](https://app.codacy.com/gh/Ajimaru/OctoPrint-LogMonitor/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Coverage](https://img.shields.io/codecov/c/github/Ajimaru/OctoPrint-LogMonitor?style=flat-square&logo=codecov&logoColor=white)](https://codecov.io/gh/Ajimaru/OctoPrint-LogMonitor)
[![Pylint Score](https://img.shields.io/badge/pylint-10.0-green?style=flat-square&logo=python&logoColor=white)](https://www.pylint.org/)
[![Bandit Security](https://img.shields.io/badge/bandit-security-green?style=flat-square&logo=python&logoColor=white)](https://bandit.readthedocs.io/en/latest/)
[![Depfu](https://badges.depfu.com/badges/b1bd984976a5ccb7ac298737eabe686f/status.svg)](https://depfu.com)
[![Known Vulnerabilities](https://snyk.io/test/github/Ajimaru/OctoPrint-LogMonitor/badge.svg)](https://snyk.io/test/github/Ajimaru/OctoPrint-LogMonitor)

Expand Down
39 changes: 0 additions & 39 deletions eslint.config.mjs

This file was deleted.

Loading