Skip to content
Snippets Groups Projects
Commit 10c024a9 authored by Marco Clemencic's avatar Marco Clemencic Committed by Sebastien Ponce
Browse files

Update clang-format and switch to Ruff for Python linting and formatting

parent 5f3e2b47
No related branches found
No related tags found
1 merge request!4224Update clang-format and switch to Ruff for Python linting and formatting
This commit is part of merge request !4224. Comments created here will be created in the context of that merge request.
...@@ -113,6 +113,10 @@ Standard: Cpp11 ...@@ -113,6 +113,10 @@ Standard: Cpp11
TabWidth: 8 TabWidth: 8
UseTab: Never UseTab: Never
--- ---
Language: Json
IndentWidth: 4
ColumnLimit: 120
---
Language: JavaScript Language: JavaScript
ColumnLimit: 120 ColumnLimit: 120
--- ---
......
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
variables: variables:
TARGET_BRANCH: master TARGET_BRANCH: master
default:
tags: [cvmfs]
check-copyright: check-copyright:
image: gitlab-registry.cern.ch/ci-tools/ci-worker:cc7 image: gitlab-registry.cern.ch/ci-tools/ci-worker:cc7
script: script:
......
repos: repos:
- repo: local - repo: local
hooks: hooks:
- id: clang-format
name: clang-format
types_or: [c++, c, cuda]
language: system
entry: /cvmfs/lhcb.cern.ch/lib/bin/x86_64-almalinux9/lcg-clang-format-8.0.0 -i
args: ["-style=file"]
require_serial: false
- id: clang-format
name: clang-format (non-standard extensions)
types_or: [file]
files: \.(icc|icpp)$
language: system
entry: /cvmfs/lhcb.cern.ch/lib/bin/x86_64-almalinux9/lcg-clang-format-8.0.0 -i
args: ["-style=file"]
require_serial: false
- id: test-inputs-use-testfiledb - id: test-inputs-use-testfiledb
name: test inputs use TestFileDB name: test inputs use TestFileDB
description: make sure all inputs to test options files are going through FileTestDB description: make sure all inputs to test options files are going through FileTestDB
...@@ -23,7 +8,28 @@ repos: ...@@ -23,7 +8,28 @@ repos:
types_or: [python, yaml] types_or: [python, yaml]
exclude: ".pre-commit-config.yaml" exclude: ".pre-commit-config.yaml"
entry: 'eoslhcb.cern.ch//eos/lhcb/.*$(?<!fillingscheme.txt")' entry: 'eoslhcb.cern.ch//eos/lhcb/.*$(?<!fillingscheme.txt")'
- repo: https://github.com/pre-commit/mirrors-yapf - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v0.24.0 rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
exclude: "\\.clang-format$"
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format
- id: clang-format
name: clang-format (non-standard extensions)
types_or: [file]
files: \.(icc|icpp)$
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.1
hooks: hooks:
- id: yapf # Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
ruff.toml 0 → 100644
[lint]
select = [
# Pyflakes
"F",
# Pycodestyle
"E71",
"E9",
"W1",
"W6",
# isort
"I001"
]
ignore = [
# this is disabled for now, as we have imports with side effects
# and isort breaks such code
"F401", # unsued import
"F403", # import *
"F405", # `xyz` may be undefined, or defined from star imports
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment