Contributions in German or English are welcome. Language synchronization is handled by the maintainer no later than post-merge.
This repository provides a compact, battle-tested baseline for consistent Delphi code. It focuses on:
- A clear, modern Delphi Style Guide (German and English)
- A curated .gitignore tailored for Delphi
- A Git Attributes template for EOL normalization and binary protection
Both help teams write consistent code and avoid common friction.
Teams frequently commit files that should not be versioned (IDE artifacts, build outputs, local settings). This leads to:
- unnecessary diffs and merge conflicts
- unstable builds due to local artifacts
- unwanted side effects across the team
The curated, Delphi-specific .gitignore prevents exactly that. The Style Guide, in parallel, provides a shared understanding of structure, naming, and modern language features. Additionally, .gitattributes prevents false diffs due to line-ending mismatches (CRLF vs LF) and protects binary artifacts from accidental text filters/diff. See the contents section for details.
Beyond team settings, a consistent Style Guide also benefits solo developers over the long run. This guide follows proven, classic patterns seen in Delphi's RTL/VCL/FMX code, yet it is certainly opinionated. The most important thing is to agree on a style and apply it consistently across the codebase—consistency beats “perfect.”
- Curated GitIgnore template: Delphi GitIgnore.txt
- Git Attributes template: Delphi GitAttributes.txt
- Delphi Style Guide (DE): Delphi Style Guide DE.md
- Delphi Style Guide (EN): Delphi Style Guide EN.md
- Release Tools: release-tools/ - Automated release creation
Note: The style guide is maintained in German and English. Please keep both documents in sync (maintainer will handle synchronization post-merge if needed).
- Agree on the style guide in your team
- Indentation: 2 spaces; line length: 120 chars (keep formatter/editor guideline in sync)
- Naming conventions (A-/L-/F‑prefixes, components, constants, enums with SCOPEDENUMS)
- Modern features: generics, anonymous methods, inline variables (10.3+), multiline strings (12+)
- Enable .gitignore
- Copy "Delphi GitIgnore.txt" to the repo root and rename it to ".gitignore"
- Add project-specific rules as needed
- Add Git Attributes
- Copy "Delphi GitAttributes.txt" to the repo root and rename it to ".gitattributes".
- It normalizes EOLs for Delphi sources (CRLF) and marks binary artifacts (.res, .ico, .dcu, .bpl, .dll, .exe) as binary.
- If your project stores .dfm/.fmx as text (default), keep the text rules. If stored as binary, switch to the binary rules in the template.
- For existing repos, after adding run:
git add --renormalize .and commit the changes.
Official releases are available in the release-assets/ directory. Each release includes:
- PDF versions of the style guides (German and English)
- Git templates (.gitignore and .gitattributes)
- Documentation
For creating new releases, see release-tools/README.md.
- Issues and PRs are welcome
- Single-language PRs (DE or EN) are fine; maintainer will sync the other language after merge
- Provide configuration templates for code formatters to implement this style guide (e.g., 2-space indentation, 120-char line length, synchronized vertical guideline)...
- Shared project presets (.dproj) or IDE settings for teams
MIT License – see notices in the files