file_naming_conventions
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| file_naming_conventions [2026-03-10 06:45 pm] – hcho | file_naming_conventions [2026-05-31 06:21 pm] (current) – [Technical identifiers] hcho | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== File naming conventions ====== | ====== File naming conventions ====== | ||
| - | This page defines the file naming conventions used in this repository. | + | This page defines the filename and directory |
| ===== General principles ===== | ===== General principles ===== | ||
| - | * Use descriptive | + | * Use descriptive |
| - | * Avoid spaces | + | * Use only lowercase letters (a-z), digits (0-9), hyphens (-), and underscores (_). |
| - | * Use lowercase letters. | + | * Avoid spaces |
| - | * Separate words consistently using hyphens or underscores | + | * Use **hyphens (-)** for named entities intended primarily for human reading and reference. |
| + | * Use **underscores | ||
| + | |||
| + | ===== Directory names ===== | ||
| + | |||
| + | Directory names use **hyphens**, | ||
| + | |||
| + | Examples: | ||
| + | |||
| + | submission-docs/ | ||
| + | review-response/ | ||
| + | fig-study-area/ | ||
| + | build-scripts/ | ||
| ===== Documentation and manuscripts ===== | ===== Documentation and manuscripts ===== | ||
| - | Documentation files, manuscripts, | + | Documentation files, manuscripts, |
| Examples: | Examples: | ||
| + | main.tex | ||
| cover-letter.tex | cover-letter.tex | ||
| cover-letter.pdf | cover-letter.pdf | ||
| review-response.tex | review-response.tex | ||
| - | | + | response-macros.tex |
| fig-study-basin.tex | fig-study-basin.tex | ||
| - | fig-study-basin.pdf | ||
| tab-algorithms.tex | tab-algorithms.tex | ||
| - | | + | |
| Hyphens improve readability and match conventions commonly used in documentation, | Hyphens improve readability and match conventions commonly used in documentation, | ||
| - | ===== Source code ===== | + | ===== Workflow scripts |
| - | Source code files use **underscores** to separate words. | + | Workflow scripts are treated as command-line tools and therefore also use **hyphens**. |
| + | |||
| + | If the execution order matters, a numeric prefix may be used. | ||
| Examples: | Examples: | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | Underscores are preferred because they are compatible with programming identifiers and module imports. | + | |
| ===== Command-line tools ===== | ===== Command-line tools ===== | ||
| - | Command-line interface (CLI) programs use **hyphens** in their executable names because they are user-facing commands. | + | Command-line interface (CLI) programs use **hyphens** in executable names because they are user-facing commands. |
| Examples: | Examples: | ||
| Line 50: | Line 62: | ||
| mesh-builder | mesh-builder | ||
| - | Hyphenated command names improve readability | + | ===== Software source code ===== |
| + | |||
| + | Software source code files use **underscores** to separate words. This ensures compatibility with programming identifiers | ||
| + | |||
| + | Examples: | ||
| + | |||
| + | flow_direction.py | ||
| + | longest_flow_path.py | ||
| + | mesh_builder.cpp | ||
| + | grid_utils.h | ||
| + | |||
| + | ===== GIS datasets and technical identifiers ===== | ||
| + | |||
| + | GIS datasets and technical identifiers use **underscores** to separate words. This ensures compatibility | ||
| + | |||
| + | Examples: | ||
| + | |||
| + | gcn10_amc_i.tif | ||
| + | gcn10_amc_ii.tif | ||
| + | nm_hydro_basins.gpkg | ||
| + | stream_order.parquet | ||
| ===== Generated files ===== | ===== Generated files ===== | ||
| Line 59: | Line 91: | ||
| cover-letter.tex → cover-letter.pdf | cover-letter.tex → cover-letter.pdf | ||
| - | |||
| - | This avoids unnecessary renaming during the build process. | ||
| - | |||
| - | ===== Exceptions ===== | ||
| - | |||
| - | Some ecosystems have their own naming conventions and should follow those conventions. For example, GRASS modules follow the GRASS naming scheme. | ||
file_naming_conventions.1773189942.txt.gz · Last modified: by hcho
