Skip to content

Commit 0ab6379

Browse files
introduce workspace-config/ with shared repo configuration files
Move .editorconfig into workspace-config/ and add .gitattributes (LF enforcement, binary markers) and .gitignore-template. Update README with new repository structure. Fixes #10
1 parent aa48a53 commit 0ab6379

5 files changed

Lines changed: 90 additions & 6 deletions

File tree

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,17 @@ tooling/
145145
│ ├── update-issue-section/
146146
│ ├── update-readme-release-info/
147147
│ └── validate-release-plan/
148-
└── validation/
149-
├── schemas/ # JSON/YAML schemas
150-
│ ├── release-plan-schema.yaml
151-
│ └── release-metadata-schema.yaml
152-
└── scripts/
153-
└── validate-release-plan.py
148+
├── validation/
149+
│ ├── schemas/ # JSON/YAML schemas
150+
│ │ ├── release-plan-schema.yaml
151+
│ │ └── release-metadata-schema.yaml
152+
│ └── scripts/
153+
│ └── validate-release-plan.py
154+
└── workspace-config/ # Shared root-level config files for API repos
155+
├── .editorconfig
156+
├── .gitattributes
157+
├── .gitignore-template
158+
└── README.md
154159
```
155160

156161
## Release Information

workspace-config/.gitattributes

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Normalize all text files to LF line endings on commit.
2+
# Contributors on Windows will still see CRLF in their working tree
3+
# (if core.autocrlf is set), but the repository always stores LF.
4+
* text=auto eol=lf
5+
6+
# Explicitly mark binary formats so Git never attempts EOL conversion.
7+
*.png binary
8+
*.jpg binary
9+
*.jpeg binary
10+
*.gif binary
11+
*.ico binary
12+
*.pdf binary
13+
*.zip binary
14+
*.tar.gz binary
15+
*.pptx binary
16+
*.docx binary
17+
*.xlsx binary
18+
19+
# Slim down release artifacts by excluding meeting minutes.
20+
/documentation/MeetingMinutes export-ignore
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# OS-generated files
2+
.DS_Store
3+
Thumbs.db
4+
Desktop.ini
5+
6+
# Editor / IDE files
7+
.idea/
8+
.vscode/
9+
*.swp
10+
*.swo
11+
*~
12+
13+
# Node (used by some linting/tooling setups)
14+
node_modules/
15+
16+
# Python
17+
__pycache__/
18+
*.pyc
19+
.venv/

workspace-config/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Workspace Configuration
2+
3+
Shared configuration files that should be placed in the **root** of each CAMARA API repository.
4+
5+
These files standardize editor behavior, line-ending enforcement, and ignored-file patterns across all contributors, regardless of OS or IDE.
6+
7+
## Files
8+
9+
| File | Purpose | Placement in API repo |
10+
|------|---------|----------------------|
11+
| `.editorconfig` | Consistent indentation, charset, and line endings across editors ([spec](https://editorconfig.org)) | Copy as-is to repo root |
12+
| `.gitattributes` | Enforces LF line endings at the Git layer and marks binary formats | Copy as-is to repo root |
13+
| `.gitignore-template` | Common ignore patterns for OS, editor, and tooling artifacts | Copy to repo root **and rename** to `.gitignore` |
14+
15+
> `.gitignore-template` is named with a `-template` suffix so that Git does not pick it up inside this tooling repository itself.
16+
17+
## Adoption
18+
19+
To adopt these configurations in an API repository:
20+
21+
1. Copy `.editorconfig` and `.gitattributes` into the repository root.
22+
2. Copy `.gitignore-template` to the repository root and rename it to `.gitignore`. Merge with any existing `.gitignore` entries the repo already has.
23+
3. Commit and push.
24+
25+
If the repository already contains files with CRLF line endings, a separate normalization PR should be created after `.gitattributes` is in place — see [#113](https://github.com/camaraproject/tooling/issues/113) for the migration approach.
26+
27+
## How the files work together
28+
29+
- `.editorconfig` guides editors to use the correct settings **while editing**, so contributors produce correctly formatted files from the start.
30+
- `.gitattributes` acts as a **safety net at the Git layer** — even if an editor writes CRLF, Git normalizes to LF on commit.
31+
- `.gitignore` keeps OS junk and editor artifacts out of version control.
32+
33+
## Alignment with linting rules
34+
35+
The `.editorconfig` settings are derived from the existing linting configurations in [`linting/config/`](../linting/config/):
36+
37+
- **YAML** indent/whitespace rules match [`.yamllint.yaml`](../linting/config/.yamllint.yaml)
38+
- **Gherkin** indent rules match [`.gherkin-lintrc`](../linting/config/.gherkin-lintrc)
39+
40+
This keeps editor formatting and CI linting in sync, so contributors get feedback while editing rather than failing in CI.

0 commit comments

Comments
 (0)