Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,18 @@ tooling/
│ └── api_review_validator_v0_6.py
├── shared-actions/
│ └── validate-release-plan/ # Composite GitHub Action (stub)
└── validation/
├── docs/
├── schemas/ # JSON/YAML schemas
│ ├── release-plan-schema.yaml
│ └── release-metadata-schema.yaml
└── scripts/
└── validate-release-plan.py
├── validation/
│ ├── docs/
│ ├── schemas/ # JSON/YAML schemas
│ │ ├── release-plan-schema.yaml
│ │ └── release-metadata-schema.yaml
│ └── scripts/
│ └── validate-release-plan.py
└── workspace-config/ # Shared root-level config files for API repos
├── .editorconfig
├── .gitattributes
├── .gitignore-template
└── README.md
```

## Release Information
Expand Down
25 changes: 25 additions & 0 deletions workspace-config/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig - https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_style = space
indent_size = 2

[*.feature]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
20 changes: 20 additions & 0 deletions workspace-config/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Normalize all text files to LF line endings on commit.
# Contributors on Windows will still see CRLF in their working tree
# (if core.autocrlf is set), but the repository always stores LF.
* text=auto eol=lf

# Explicitly mark binary formats so Git never attempts EOL conversion.
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.pdf binary
*.zip binary
*.tar.gz binary
*.pptx binary
*.docx binary
*.xlsx binary

# Slim down release artifacts by excluding meeting minutes.
/documentation/MeetingMinutes export-ignore
19 changes: 19 additions & 0 deletions workspace-config/.gitignore-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# OS-generated files
.DS_Store
Thumbs.db
Desktop.ini

# Editor / IDE files
.idea/
.vscode/
*.swp
*.swo
*~

# Node (used by some linting/tooling setups)
node_modules/

# Python
__pycache__/
*.pyc
.venv/
40 changes: 40 additions & 0 deletions workspace-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Workspace Configuration

Shared configuration files that should be placed in the **root** of each CAMARA API repository.

These files standardize editor behavior, line-ending enforcement, and ignored-file patterns across all contributors, regardless of OS or IDE.

## Files

| File | Purpose | Placement in API repo |
|------|---------|----------------------|
| `.editorconfig` | Consistent indentation, charset, and line endings across editors ([spec](https://editorconfig.org)) | Copy as-is to repo root |
| `.gitattributes` | Enforces LF line endings at the Git layer and marks binary formats | Copy as-is to repo root |
| `.gitignore-template` | Common ignore patterns for OS, editor, and tooling artifacts | Copy to repo root **and rename** to `.gitignore` |

> `.gitignore-template` is named with a `-template` suffix so that Git does not pick it up inside this tooling repository itself.

## Adoption

To adopt these configurations in an API repository:

1. Copy `.editorconfig` and `.gitattributes` into the repository root.
2. Copy `.gitignore-template` to the repository root and rename it to `.gitignore`. Merge with any existing `.gitignore` entries the repo already has.
3. Commit and push.

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.

## How the files work together

- `.editorconfig` guides editors to use the correct settings **while editing**, so contributors produce correctly formatted files from the start.
- `.gitattributes` acts as a **safety net at the Git layer** — even if an editor writes CRLF, Git normalizes to LF on commit.
- `.gitignore` keeps OS junk and editor artifacts out of version control.

## Alignment with linting rules

The `.editorconfig` settings are derived from the existing linting configurations in [`linting/config/`](../linting/config/):

- **YAML** indent/whitespace rules match [`.yamllint.yaml`](../linting/config/.yamllint.yaml)
- **Gherkin** indent rules match [`.gherkin-lintrc`](../linting/config/.gherkin-lintrc)

This keeps editor formatting and CI linting in sync, so contributors get feedback while editing rather than failing in CI.