file_naming_conventions
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| file_naming_conventions [2026-03-10 06:43 pm] – created hcho | file_naming_conventions [2026-03-10 07:23 pm] (current) – hcho | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== File naming conventions ====== | ====== File naming conventions ====== | ||
| - | This page defines the file naming conventions used in lab repositories. | + | 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 (-)** by default. |
| + | * Use **underscores | ||
| ===== 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, URLs, and open-source repositories. |
| - | ===== Source code ===== | + | ===== Command-line tools ===== |
| - | Source | + | Command-line interface (CLI) programs use **hyphens** in executable names because they are user-facing commands. |
| + | |||
| + | Examples: | ||
| + | |||
| + | flow-direction | ||
| + | longest-flow-path | ||
| + | mesh-builder | ||
| + | |||
| + | ===== Workflow scripts ===== | ||
| + | |||
| + | 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: | ||
| + | |||
| + | 1-download-files.sh | ||
| + | 2-preprocess-files.sh | ||
| + | 3-run-model.sh | ||
| + | 4-postprocess-results.sh | ||
| + | |||
| + | ===== Software source code ===== | ||
| + | |||
| + | Software source | ||
| Examples: | Examples: | ||
| Line 38: | Line 62: | ||
| grid_utils.h | grid_utils.h | ||
| - | Underscores are preferred because they are compatible with programming | + | ===== Directory names ===== |
| + | |||
| + | Directory names use **hyphens**, | ||
| + | |||
| + | Examples: | ||
| + | |||
| + | submission-docs/ | ||
| + | review-response/ | ||
| + | fig-study-area/ | ||
| + | build-scripts/ | ||
| ===== Generated files ===== | ===== Generated files ===== | ||
| Line 47: | Line 80: | ||
| 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.1773189811.txt.gz · Last modified: by hcho
