Skip to content

ci: add file hygiene workflow and canonical config templates#1758

Closed
yshyn-iohk wants to merge 5 commits into
mainfrom
ci/file-hygiene
Closed

ci: add file hygiene workflow and canonical config templates#1758
yshyn-iohk wants to merge 5 commits into
mainfrom
ci/file-hygiene

Conversation

@yshyn-iohk
Copy link
Copy Markdown
Contributor

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

Summary

Implements file hygiene linting for cloud-agent as part of the org-wide rollout (hyperledger-identus/hyperledger-identus#172).

1. CI workflow and lint configuration

  • Add file-hygiene.yml caller workflow invoking the reusable lint-files.yml from hyperledger-identus/.github
  • Add canonical .gitattributes, .editorconfig, .markdownlint.yml, .yamllint.yml, .shellcheckrc
  • Add .markdownlint-cli2.yaml with ignore patterns for generated/vendored files (API clients, node_modules, Helm charts, OpenAPI spec)

2. Changelog cleanups

  • Remove outdated CHANGELOG.md from 6 subdirectories (castor, cloud-agent/service, connect, mercury, pollux, prism-node/client/scala-client)
  • Root CHANGELOG.md is the single source of truth

3. Lint fixes across the repo (65 files)

  • Markdownlint auto-fix (~1000 issues): trailing spaces, blank lines around headings/lists/fences, multiple blank lines
  • Manual markdown fixes: table alignment (MD060), broken anchor links (MD051), numbered list continuity (MD029), blockquote formatting (MD028)
  • YAML fixes: missing final newlines, trailing spaces
  • ShellCheck fixes: separate declare/assign (SC2155), cd without exit (SC2164), export unused var (SC2034)

4. .git-blame-ignore-revs

  • Add the mass formatting commit to blame ignore list so git blame skips past formatting-only changes

5. Maintainers update

  • Add Fabio Pinheiro and Allain Magyar to active maintainers
  • Update Pat Losoponkul GitHub ID (patlo-iogpatextreme)
  • Move Björn Sandmann, David Poltorak, and Shailesh Patil to emeritus
  • Fix GitHub team name (open-enterprise-agent-maintainersidentus-maintainers)
  • Update company affiliation from IOHK to IOG

Scalafmt compatibility

No conflict — scalafmt (2-space indent, maxColumn = 120) and editorconfig-checker operate at different levels. See analysis comment.

Test plan

  • File Hygiene (editorconfig) — passing
  • Markdown lint — passing (0 errors)
  • YAML lint — passing
  • ShellCheck — passing
  • SonarCloud — passing

🤖 Generated with Claude Code

@yshyn-iohk yshyn-iohk requested a review from a team as a code owner April 10, 2026 06:14
@yshyn-iohk
Copy link
Copy Markdown
Contributor Author

Scalafmt vs EditorConfig Conflict Analysis

No conflict. Here's why:

Setting .editorconfig .scalafmt.conf Conflict?
Indent size 2 spaces (from [*]) 2 spaces (scalafmt default) No
Indent style spaces spaces (scalafmt default) No
Max line length not set maxColumn = 120 No — different tools, different scope
Charset UTF-8 (no BOM) n/a No
Line endings LF n/a No

Scalafmt and editorconfig-checker operate at different levels: scalafmt reformats Scala AST (imports, alignment, wrapping), while editorconfig-checker validates raw file bytes (BOM, line endings, trailing whitespace). They don't step on each other.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

Integration Test Results (prism-node)

1 tests  ±0   1 ✅ ±0   2s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit fd6a3c3. ± Comparison against base commit d0f1b19.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

Integration Test Results

 23 files  ±0   23 suites  ±0   4s ⏱️ ±0s
 58 tests ±0   58 ✅ ±0  0 💤 ±0  0 ❌ ±0 
106 runs  ±0  106 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit fd6a3c3. ± Comparison against base commit d0f1b19.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

Unit Test Results

113 files  ±0  113 suites  ±0   24m 6s ⏱️ +16s
927 tests ±0  919 ✅ ±0  8 💤 ±0  0 ❌ ±0 
934 runs  ±0  926 ✅ ±0  8 💤 ±0  0 ❌ ±0 

Results for commit fd6a3c3. ± Comparison against base commit d0f1b19.

♻️ This comment has been updated with latest results.

@yshyn-iohk
Copy link
Copy Markdown
Contributor Author

Lint Triage Summary

Linter Errors Warnings Files Status
File Hygiene (editorconfig) 0 0 - ✅ Passed
Markdown 1209 0 77 ❌ Failed
YAML ~100 ~656 ~30 ❌ Failed
ShellCheck 18 0 ~8 ❌ Failed

Markdown — Top errors (auto-fixable marked with 🔧)

Rule Count Auto-fix?
MD012 — multiple blank lines 241 🔧
MD032 — blanks around lists 213 🔧
MD022 — blanks around headings 213 🔧
MD001 — heading increment (h1→h3) 187 Config: mostly CHANGELOG.md files
MD031 — blanks around fences 99 🔧
MD042 — empty links 34 Manual
MD036 — emphasis as heading 34 Manual
MD009 — trailing spaces 25 🔧
MD040 — code block language 24 Manual
MD041 — first line not heading 20 Config: MD041: false
MD060 — table alignment 19 Manual

~800 of 1209 errors are auto-fixable with markdownlint-cli2 --fix.

YAML — Top errors

Rule Count Action
document-start (missing ---) ~55 Config: document-start: disable
syntax errors (braces/indent) ~30 Mostly in OpenAPI spec and Helm templates — need exclusions
comments spacing ~30 Config: comments: {min-spaces-from-content: 1}

Most YAML warnings are config-fixable. Syntax errors come from Helm templates (Go templating in YAML) and large OpenAPI specs which need to be excluded from yamllint.

ShellCheck — 18 warnings across 8 files

Rule Count Description
SC2221/SC2222 10 Case pattern overrides (benign)
SC2155 3 Declare and assign separately
SC3045 2 POSIX ulimit (in gradlew — generated file)
SC2034 2 Unused variable
SC2164 1 cd without

Strategy: Config fixes + --fix auto-fix first, then manual fixes for the remaining ~400 issues. Generated files (gradlew, OpenAPI spec) should be excluded.

Copy link
Copy Markdown
Contributor

@FabioPinheiro FabioPinheiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split it in three commits:
1- Code/Files
2- Auto generated changes
3- Add the second commit to the .git-blame-ignore-revs
Don't squash the commits when merging

Comment thread MAINTAINERS.md Outdated
yshyn-iohk and others added 5 commits April 11, 2026 00:39
Add reusable file-hygiene workflow caller and canonical lint configs:

- .github/workflows/file-hygiene.yml: caller for lint-files.yml
- .editorconfig: UTF-8 (no BOM), LF line endings, indent rules
- .gitattributes: LF normalization for text files, binary rules
- .markdownlint.yml: markdownlint rules with relaxations for this repo
- .markdownlint-cli2.yaml: ignore patterns for generated/vendored files
- .markdownlintignore: local ignore patterns
- .yamllint.yml: yamllint rules with relaxations for Docker Compose,
  Helm templates, and OpenAPI specs
- .shellcheckrc: suppress intentional case pattern overlap and
  generated gradlew warnings

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>
Remove CHANGELOG.md from castor/, cloud-agent/service/, connect/,
mercury/, pollux/, and prism-node/client/scala-client/.

The root CHANGELOG.md is the single source of truth for release notes.

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>
Markdownlint auto-fix (--fix) resolved ~1000 issues:
- MD009: trailing spaces
- MD012: multiple consecutive blank lines
- MD022: missing blank lines around headings
- MD031: missing blank lines around fenced code blocks
- MD032: missing blank lines around lists
- MD047: missing final newline

Manual fixes:
- MD060: reformat misaligned tables in MAINTAINERS.md, infrastructure
  READMEs, vdr/manage.md, research doc
- MD051: fix broken anchor link in signing-commits.md
- MD028: merge consecutive blockquotes in linting.md
- MD029: fix numbered list continuity in credentialdefinition/create.md,
  credentials/connectionless/issue.md, schemas/create.md,
  authserver-oid4vci-contract.md

YAML fixes:
- Add final newline to dependabot.yml and apisix config.yaml
- Trim trailing spaces in .allstar/binary_artifacts.yaml

ShellCheck fixes:
- SC2155: separate declare and assign in keycloak/init-script.sh and
  get-versions.sh
- SC2164: add || exit after cd in get-versions.sh
- SC2034: export PORT in multi/stop.sh

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>
Add the mass lint auto-fix commit (03b3786) to the blame ignore list
so git blame skips past formatting-only changes.

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>
Active maintainers:
- Add Fabio Pinheiro (FabioPinheiro) and Allain Magyar (amagyar-iohk)
- Update Pat Losoponkul GitHub ID from patlo-iog to patextreme
- Update GitHub team from open-enterprise-agent-maintainers to
  identus-maintainers
- Update company affiliation from IOHK to IOG
- Fix sublist formatting in "Becoming a Maintainer" section

Emeritus maintainers:
- Move Björn Sandmann (bsandmann), David Poltorak (davidpoltorak-io),
  and Shailesh Patil (mineme0110) to emeritus

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>
@sonarqubecloud
Copy link
Copy Markdown

@yshyn-iohk
Copy link
Copy Markdown
Contributor Author

Thanks, @FabioPinheiro, for the nice recommendation about adding autoformatted changes to .git-blame-ignore-revs.

@FabioPinheiro
Copy link
Copy Markdown
Contributor

but now you can't squash merge. And if you rebase you need to update the commit id on .git-blame-ignore-revs

@yshyn-iohk
Copy link
Copy Markdown
Contributor Author

All commits from this PR were rebased on the main branch with the correction of the .git-blame-ignore-revs file.
The local main branch was pushed by the repository administration to the origin.

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.

3 participants