From 49571ed50792ba1baa66979432b6c888512b55fd Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Fri, 26 Apr 2024 14:14:39 +0200 Subject: [PATCH 1/2] Changed pre-commit and ruff config * Added a manual version of ruff auto-fixing all problems. Run it with: pre-commit run --hook-stage manual * allow "confusable" en-dash * updated ruff version (reason: better handling of semicolons in Jupyter notebook code cells) --- .pre-commit-config.yaml | 15 +++++++++++++-- pyproject.toml | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e822be2e6b7..ead99e4cdfd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -79,12 +79,23 @@ repos: args: [sync] - id: vale args: [--output=line, --minAlertLevel=error] - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.1.0" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.4.2" hooks: - id: ruff types_or: [python, pyi, jupyter] args: [--show-source] + # A variant of the ruff hook above that automatically applies proposed fixes. + # Runs only manually. + # Run this hook (and all other manual hooks if any) with: + # pre-commit run --hook-stage manual + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.4.2" + hooks: + - id: ruff + types_or: [python, pyi, jupyter] + args: [--show-source, --fix, --exit-non-zero-on-fix] + stages: [manual] # Enable on demand, run with # pre-commit run --all-files clang-format # diff --git a/pyproject.toml b/pyproject.toml index ab5aa9e0521..280586d883c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -134,6 +134,10 @@ exclude = ["scripts/doc", "*ci-skip*"] flake8-unused-arguments.ignore-variadic-names = true line-length = 80 +[tool.ruff.lint] +# allow en-dash +allowed-confusables = ["–"] + [tool.ruff.per-file-ignores] "tests/**" = ["T20"] "*.ipynb" = ["E402"] # Top-level imports From bfbbf4b2eb9cfc826ac0a93b0699624580c83cb4 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Mon, 6 May 2024 10:51:56 +0200 Subject: [PATCH 2/2] [NL] Fixed missing include. --- NumLib/TimeStepping/TimeStep.h | 1 + 1 file changed, 1 insertion(+) diff --git a/NumLib/TimeStepping/TimeStep.h b/NumLib/TimeStepping/TimeStep.h index d712d4453a9..ce975f36f91 100644 --- a/NumLib/TimeStepping/TimeStep.h +++ b/NumLib/TimeStepping/TimeStep.h @@ -13,6 +13,7 @@ #pragma once #include +#include namespace NumLib {