Skip to content

add linting and AGENTS.md - #30

Merged
aspiers merged 2 commits into
hypercerts-org:mainfrom
aspiers:linting
Dec 9, 2025
Merged

add linting and AGENTS.md#30
aspiers merged 2 commits into
hypercerts-org:mainfrom
aspiers:linting

Conversation

@aspiers

@aspiers aspiers commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores

    • Added code formatting and linting configurations to standardize code style.
    • Enabled automated linting checks on pushes and pull requests.
    • Added EditorConfig to enforce consistent editor settings across environments.
  • Documentation

    • Updated README with formatting improvements.
    • Added comprehensive developer guidance documentation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 9, 2025

Copy link
Copy Markdown

Walkthrough

The PR establishes code formatting and linting infrastructure by introducing EditorConfig, Prettier configuration with tooling, GitHub Actions workflows for automated linting, and developer documentation, along with minor formatting adjustments to existing files.

Changes

Cohort / File(s) Summary
Configuration & Tooling Setup
.editorconfig, .prettierrc, .prettierignore, package.json
Added EditorConfig with global formatting rules (2-space indent, LF line endings, UTF-8 charset) and Makefile tab override. Added Prettier configuration (80-char width, double quotes, trailing commas, 2-space tabs). Prettier devDependency and three npm scripts added: format, format:check, lint.
CI/CD Workflows
.github/workflows/lint.yml, .github/workflows/test.yml
Created lint workflow for ubuntu-latest that checks out code, sets up Node.js 20 with npm cache, installs dependencies, and runs linter on push and pull requests to main. Minor quote formatting change in test.yml.
Documentation
AGENTS.md, README.md
Added comprehensive AGENTS.md guide for AI contributors covering project structure, build commands, architecture, patterns, and lexicon management. Updated README.md with consistent code formatting (double quotes, semicolons, trailing commas) and Markdown table adjustments.
Lexicon Data Files
lexicons/com/atproto/repo/strongRef.json, lexicons/org/hypercerts/claim/contribution.json, lexicons/org/hypercerts/claim/rights.json
Trailing newline added to strongRef.json, trailing newlines removed from contribution.json, and multi-line reformatting applied to rights.json required array. No semantic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Configuration changes are straightforward and follow standard conventions
  • Workflow YAML additions are templated and conventional
  • Documentation additions are informational with no code impact
  • Lexicon whitespace changes are mechanical and require minimal scrutiny

🐰 With prettier and lint so tight,
Our code now sparkles, formatted right!
EditorConfig guides the way,
And workflows run both night and day.
No more debates on tabs or spaces—
Just happy rabbits in all our places! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the two main changes: adding linting infrastructure (EditorConfig, Prettier, linting workflows) and the new AGENTS.md documentation file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
README.md (1)

121-121: Address style issues identified in documentation.

Several instances of redundant or verbose phrasing have been flagged by static analysis in table cells being reformatted:

  • "originally created" → simplify to "created" (lines 121, 142, 163, 184, 208, 257)
  • "exact same role" → simplify to "same role" (line 138)
  • "etc)" → add period: "etc.)" (line 158)

These are low-cost fixes since you're already reformatting these lines. Addressing them will improve documentation clarity.

Also applies to: 138-138, 142-142, 158-158, 163-163, 184-184, 208-208, 257-257

AGENTS.md (1)

96-116: Add language specifier to code block.

The directory structure code block at line 96 is missing a language specifier. This violates markdownlint rules (MD040).

Apply this diff to fix the code block:

-\`\`\`
+\`\`\`plaintext
 lexicons/
   app/certified/location.json
   com/atproto/repo/strongRef.json
   org/hypercerts/
     claim/
       activity.json
       collection.json
       contribution.json
       evaluation.json
       evidence.json
       measurement.json
       rights.json
     defs.json
 
 types/              # Generated - do not edit
   index.ts
   lexicons.ts
   types/
   util.ts
-\`\`\`
+\`\`\`plaintext
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 742a74c and 13ae2d8.

📒 Files selected for processing (11)
  • .editorconfig (1 hunks)
  • .github/workflows/lint.yml (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • .prettierignore (1 hunks)
  • .prettierrc (1 hunks)
  • AGENTS.md (1 hunks)
  • README.md (9 hunks)
  • lexicons/com/atproto/repo/strongRef.json (1 hunks)
  • lexicons/org/hypercerts/claim/contribution.json (0 hunks)
  • lexicons/org/hypercerts/claim/rights.json (1 hunks)
  • package.json (2 hunks)
💤 Files with no reviewable changes (1)
  • lexicons/org/hypercerts/claim/contribution.json
🧰 Additional context used
🪛 LanguageTool
README.md

[style] ~121-~121: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created | ...

(ORIGINALLY_CREATED)


[style] ~138-~138: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...tContribution, then they would have the exact same role. | | | description | `...

(EN_WORDINESS_PREMIUM_EXACT_SAME)


[style] ~142-~142: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created ...

(ORIGINALLY_CREATED)


[style] ~158-~158: In American English, abbreviations like “etc.” require a period.
Context: ...g measurement, hypercert, contribution, etc) | | evaluators | array | ✅ ...

(ETC_PERIOD)


[style] ~163-~163: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created | ...

(ORIGINALLY_CREATED)


[style] ~184-~184: This phrase is redundant. Consider writing “created”.
Context: ...timestamp when this hypercert claim was originally created | ...

(ORIGINALLY_CREATED)


[style] ~208-~208: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created | ...

(ORIGINALLY_CREATED)


[style] ~257-~257: This phrase is redundant. Consider writing “created”.
Context: ...declared timestamp when this record was originally created | | --- ## Notes - All t...

(ORIGINALLY_CREATED)

🪛 markdownlint-cli2 (0.18.1)
AGENTS.md

96-96: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (10)
.github/workflows/test.yml (1)

19-20: LGTM!

The quote style changes align with the new formatting standards being introduced across the repository. No functional impact on the workflow.

lexicons/com/atproto/repo/strongRef.json (1)

15-15: LGTM!

The trailing newline addition aligns with the .editorconfig setting for consistent file formatting across the repository.

lexicons/org/hypercerts/claim/rights.json (1)

11-16: LGTM!

The multi-line formatting of the required array improves readability and aligns with the new Prettier configuration (printWidth: 80). No semantic changes.

.prettierignore (1)

1-9: LGTM!

The ignore patterns are appropriate and comprehensive. Notably, types/ is correctly excluded since it contains auto-generated code, which aligns with the guidance in AGENTS.md.

.prettierrc (1)

1-10: LGTM!

The Prettier configuration is well-structured and consistent with .editorconfig. The choices (trailing commas, double quotes, 80-char printWidth, 2-space indent) follow modern best practices and provide clear formatting standards.

.editorconfig (1)

1-14: LGTM!

The EditorConfig is comprehensive and follows conventions. The universal rules ensure consistent formatting (LF, UTF-8, 2-space indent, trim trailing whitespace), and the Makefile exception correctly uses tabs. Aligns well with .prettierrc settings.

README.md (1)

27-28: LGTM!

The formatting changes (quote style, table alignment) align well with the new Prettier configuration and improve consistency across the documentation.

Also applies to: 64-64, 84-84, 109-110, 135-136, 156-157, 177-178, 198-199, 251-252

AGENTS.md (1)

1-155: LGTM!

AGENTS.md provides excellent guidance for contributors and AI assistants. The documentation clearly explains the auto-generated nature of the types/ directory, regeneration workflows, and project structure. This will be valuable for future maintenance and development.

package.json (1)

38-40: Scripts are well-structured and follow npm conventions.

The delegation pattern (lint → format:check) is clean and allows flexible usage: developers can run npm run format to auto-fix, npm run format:check to validate, or npm run lint as the enforcement target.

.github/workflows/lint.yml (1)

1-26: GitHub Actions workflow is properly configured and follows CI/CD best practices.

The workflow correctly:

  • Triggers on push and PR to main (lines 3-7)
  • Uses current, stable action versions (checkout@v4, setup-node@v4) with Node.js 20 (lines 14-20)
  • Enables npm caching to avoid redundant downloads (line 20)
  • Uses npm ci for deterministic dependency installation (line 23)
  • Delegates to the package.json lint script for consistency (line 26)

@aspiers
aspiers merged commit 68fb0a3 into hypercerts-org:main Dec 9, 2025
3 checks passed
@aspiers
aspiers deleted the linting branch December 9, 2025 16:08
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.

1 participant