Skip to content

Commit

Permalink
style: add meson format pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Jan 4, 2025
1 parent a7eaf39 commit 4d3d04b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
repos:
- repo: https://github.com/trim21/pre-commit-mirror-meson
rev: 'v1.6.1'
hooks:
- id: meson-fmt
args: [-e, -i]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
hooks:
Expand All @@ -24,7 +30,7 @@ repos:
- id: trailing-whitespace
exclude: '.*\.bin'
- id: mixed-line-ending
args: [--fix=lf]
args: [ --fix=lf ]
exclude: '.*\.bin'
- id: end-of-file-fixer
exclude: '.*\.bin'
Expand All @@ -35,7 +41,7 @@ repos:
rev: v19.1.5
hooks:
- id: clang-format
types_or: [c++, c, cuda]
types_or: [ c++, c, cuda ]

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
Expand Down
4 changes: 1 addition & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ out = py.extension_module(
'src/bencode2/decode.cpp',
install: true,
include_directories: include_directories(
[
'./vendor/small_vector/source/include/',
],
['./vendor/small_vector/source/include/'],
),
subdir: 'bencode2',
dependencies: [
Expand Down
14 changes: 7 additions & 7 deletions subprojects/packagefiles/fmt-11.1.1/meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
project(
'fmt',
'cpp',
version: '11.1.1',
license: 'MIT WITH fmt-exception',
default_options: ['cpp_std=c++14'],
'fmt',
'cpp',
version: '11.1.1',
license: 'MIT WITH fmt-exception',
default_options: ['cpp_std=c++14'],
)

fmt_header_only_dep = declare_dependency(
include_directories: 'include',
compile_args: '-DFMT_HEADER_ONLY',
include_directories: 'include',
compile_args: '-DFMT_HEADER_ONLY',
)

0 comments on commit 4d3d04b

Please sign in to comment.