diff --git a/.cmake-format.json b/.cmake-format.json new file mode 100644 index 0000000000..6961a1fbc8 --- /dev/null +++ b/.cmake-format.json @@ -0,0 +1,32 @@ +{ + "encode": { + "emit_byteorder_mark": false, + "input_encoding": "utf-8", + "output_encoding": "utf-8" + }, + "format": { + "always_wrap": [], + "autosort": false, + "command_case": "lower", + "dangle_align": "prefix", + "dangle_parens": true, + "enable_sort": true, + "keyword_case": "upper", + "layout_passes": {}, + "line_ending": "unix", + "line_width": 100, + "max_lines_hwrap": 0, + "max_pargs_hwrap": 6, + "max_prefix_chars": 0, + "max_rows_cmdline": 1, + "max_subgroups_hwrap": 2, + "min_prefix_chars": 0, + "require_valid_layout": false, + "separate_ctrl_name_with_space": false, + "separate_fn_name_with_space": false, + "tab_size": 4 + }, + "misc": { + "per_command": {} + } +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b50bdafb9..045b764b8d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,49 +1,53 @@ exclude: libmamba/tests/data/repodata_json_cache* repos: -- repo: https://github.com/psf/black + - repo: https://github.com/psf/black rev: 23.9.1 hooks: - - id: black + - id: black args: [--safe, --quiet] -- repo: https://github.com/asottile/blacken-docs + - repo: https://github.com/asottile/blacken-docs rev: 1.16.0 hooks: - - id: blacken-docs + - id: blacken-docs additional_dependencies: [black==22.3.0] -- repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: fix-encoding-pragma + - id: trailing-whitespace + - id: end-of-file-fixer + - id: fix-encoding-pragma args: [--remove] - - id: check-yaml + - id: check-yaml exclude: ^.+(/tests/|/recipe/).+$ - - id: check-toml - - id: check-json - - id: check-merge-conflict - - id: pretty-format-json + - id: check-toml + - id: check-json + - id: check-merge-conflict + - id: pretty-format-json args: [--autofix] - - id: debug-statements + - id: debug-statements language_version: python3 -- repo: https://github.com/pre-commit/mirrors-isort + - repo: https://github.com/pre-commit/mirrors-isort rev: v5.10.1 hooks: - - id: isort - exclude: tests/data -- repo: https://github.com/PyCQA/flake8 + - id: isort + exclude: tests/data + - repo: https://github.com/PyCQA/flake8 rev: 6.1.0 hooks: - - id: flake8 + - id: flake8 language_version: python3 additional_dependencies: - - flake8-typing-imports==1.15.0 - - flake8-builtins==2.1.0 - - flake8-bugbear==23.9.16 - - flake8-isort==6.1.0 -- repo: https://github.com/pre-commit/mirrors-clang-format + - flake8-typing-imports==1.15.0 + - flake8-builtins==2.1.0 + - flake8-bugbear==23.9.16 + - flake8-isort==6.1.0 + - repo: https://github.com/pre-commit/mirrors-clang-format rev: v16.0.6 hooks: - - id: clang-format + - id: clang-format args: [--style=file] exclude: ".json" + - repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-format diff --git a/dev/environment-dev-extra.yml b/dev/environment-dev-extra.yml index 6f85993b65..5d8d5b92b3 100644 --- a/dev/environment-dev-extra.yml +++ b/dev/environment-dev-extra.yml @@ -8,6 +8,7 @@ dependencies: - clang - clangxx - lld + - cmake-format # C++ Debugging - gdb - valgrind