HydroCS Wiki

Pioneering Hydrologic Computational Science

User Tools

Site Tools


howtos:how_to_format_code

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:how_to_format_code [2026-12-02 12:00 am] – hchohowtos:how_to_format_code [2026-12-02 12:05 am] (current) – hcho
Line 191: Line 191:
  
 If any formatter modifies files during a commit, the commit is aborted. Review and stage the formatted files before committing again. If any formatter modifies files during a commit, the commit is aborted. Review and stage the formatted files before committing again.
- 
-We use this config file ''.pre-commit-config.yaml'': 
-<code yaml> 
-repos: 
-  # Basic file hygiene 
-  - repo: https://github.com/pre-commit/pre-commit-hooks 
-    rev: v6.0.0 
-    hooks: 
-      - id: trailing-whitespace 
-      - id: end-of-file-fixer 
- 
-  # Python: Black 
-  - repo: https://github.com/psf/black 
-    rev: 26.10.1 
-    hooks: 
-      - id: black 
- 
-  # R: Air 
-  - repo: https://github.com/posit-dev/air-pre-commit 
-    rev: "0.13.0" 
-    hooks: 
-      - id: air-format 
- 
-  # Shell: shfmt 
-  - repo: https://github.com/scop/pre-commit-shfmt 
-    rev: v3.15.0-1 
-    hooks: 
-      - id: shfmt 
- 
-  - repo: https://github.com/pre-commit/mirrors-clang-format 
-    rev: v23.1.5 
-    hooks: 
-      - id: clang-format 
-        types_or: [c, c++, cuda] 
- 
-  # JavaScript/JSON/YAML: Prettier 
-  - repo: https://github.com/rbubley/mirrors-prettier 
-    rev: v3.10.1 
-    hooks: 
-      - id: prettier 
-        types_or: [javascript, jsx, json, yaml] 
-         
- 
-  # TOML: Tombi 
-  - repo: https://github.com/tombi-toml/tombi-pre-commit 
-    rev: v1.11.3 
-    hooks: 
-      - id: tombi-format 
- 
- 
-  # CMake: cmake-format 
-  - repo: https://github.com/cheshirekow/cmake-format-precommit 
-    rev: v0.6.13 
-    hooks: 
-      - id: cmake-format 
- 
-  # Makefile: mbake 
-  - repo: https://github.com/EbodShojaei/bake 
-    rev: v1.5.0 
-    hooks: 
-      - id: mbake-format 
- 
-</code> 
  
 ===== Notes ===== ===== Notes =====
howtos/how_to_format_code.1796169640.txt.gz · Last modified: by hcho

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki