Skip to content

feat: add reusable file linting workflow and config templates#5

Merged
yshyn-iohk merged 7 commits intomainfrom
feat/reusable-lint-workflow
Apr 10, 2026
Merged

feat: add reusable file linting workflow and config templates#5
yshyn-iohk merged 7 commits intomainfrom
feat/reusable-lint-workflow

Conversation

@yshyn-iohk
Copy link
Copy Markdown
Contributor

@yshyn-iohk yshyn-iohk commented Apr 9, 2026

Summary

  • Add reusable lint-files.yml workflow with 4 CI jobs: editorconfig-checker, ShellCheck, markdownlint, and yamllint
  • Add canonical .gitattributes (LF normalization for all text files, binary rules for images/fonts/archives)
  • Add canonical .editorconfig (UTF-8 charset, LF endings, indent rules per language)
  • Add .markdownlint.yml with sensible defaults for the org
  • Add .yamllint.yml with relaxed defaults (no line-length limit, allow on truthy for GitHub Actions)
  • Add caller lint.yml so this repo dogfoods the reusable workflow

Motivation

Implements Phase 1 of hyperledger-identus/hyperledger-identus#172. The editorconfig-checker job would have caught the BOM injection in hyperledger-identus/hyperledger-identus#168 before merge.

How other repos consume this

Each repo adds a single caller workflow:

# .github/workflows/lint.yml
name: Lint
on: [pull_request, push]
jobs:
  lint:
    uses: hyperledger-identus/.github/.github/workflows/lint-files.yml@main

And copies .gitattributes, .editorconfig, .yamllint.yml, and .markdownlint.yml from this repo as templates.

Test plan

  • Verify the reusable workflow syntax is valid (GitHub will validate on first call)
  • After merge, confirm the caller workflow runs on a test PR to this repo
  • Test calling the reusable workflow from another repo (Phase 2 rollout)

🤖 Generated with Claude Code

Add a reusable CI workflow (lint-files.yml) with editorconfig-checker,
ShellCheck, markdownlint, yamllint, and gitleaks. Include canonical
.gitattributes (LF normalization), .editorconfig (charset/indent/whitespace),
and .markdownlint.yml for consistent file hygiene across all Identus repos.

The editorconfig-checker job catches BOM and CRLF issues like the one
found in hyperledger-identus#168.

Closes hyperledger-identus/hyperledger-identus#172 (Phase 1)

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
@yshyn-iohk yshyn-iohk requested a review from a team as a code owner April 9, 2026 15:00
yshyn-iohk and others added 3 commits April 9, 2026 23:42
- actions/checkout v4 -> v6
- editorconfig-checker @main -> @v2
- ludeeus/action-shellcheck @master -> @2.0.0
- DavidAnson/markdownlint-cli2-action v19 -> v23
- frenck/action-yamllint v1 (already latest)
- gitleaks/gitleaks-action v2 (already latest)

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
- Remove [*.{scala,java,kt,kts}] section that duplicated the default
  indent_size = 2 from [*]
- Add .yamllint.yml with relaxed defaults: disable line-length,
  allow 'on' truthy value (GitHub Actions), relax comment indentation

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
yshyn-iohk and others added 2 commits April 10, 2026 00:16
Python script that compares .gitattributes, .editorconfig,
.markdownlint.yml, and .yamllint.yml in every org repo against
the canonical templates in this repo. Reports MISSING, OUTDATED,
or OK for each file in each repo.

Requires only `gh` CLI. Run with: python3 scripts/check-file-hygiene.py

Refs: hyperledger-identus/hyperledger-identus#172

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Use startswith instead of exact match so repos can append local
overrides (e.g., ktlint rules) after the canonical baseline and
still pass the audit. The canonical template must appear verbatim
at the top of the file.

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Replace tag/version references with full commit SHA hashes for
supply-chain security. Version comments kept for readability.

Resolves SonarQube finding: "Use full commit SHA hash for this dependency"

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
@yshyn-iohk yshyn-iohk merged commit f2c9e41 into main Apr 10, 2026
2 checks passed
@yshyn-iohk yshyn-iohk deleted the feat/reusable-lint-workflow branch April 10, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants