Code Formatting

Enforce Go test names using the 'When <condition>, it should <expected behavior>' pattern.

536|544|Updated Jan 18, 2021
One-click install
npx skills add https://github.com/openshift/hypershift --skill code-formatting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Code Formatting
Source: https://github.com/openshift/hypershift/tree/main/.claude/skills/code-formatting
Command: npx skills add https://github.com/openshift/hypershift --skill code-formatting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures your Go code and tests consistently meet HyperShift's strict quality and formatting standards. It eliminates manual checks for test naming conventions and reminds you of essential linting and verification steps, preventing common errors and accelerating code reviews.

Core Features & Use Cases

  • Mandatory Test Naming: Enforces the "When...it should..." format for all Go test names, improving readability and consistency.
  • Automated Linting Reminders: Prompts you to run make lint-fix and make verify to automatically fix issues and confirm code quality.
  • Spelling Verification: Reminds you to use make verify-codespell for markdown files.
  • Use Case: When writing new Go code or tests, this Skill acts as your automated quality assurance, ensuring all HyperShift-specific conventions are met before you even think about committing, saving you from rework and failed CI/CD pipelines.

Quick Start

Example of a compliant Go test name

name: "When NodePool has valid image ID, it should create Azure machine template"

Remember to run these commands after coding:

make lint-fix

make verify

Frequently Asked Questions about Code Formatting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent test naming conventions in Go?

This Skill enforces the 'When <condition>, it should <expected behavior>' pattern for all Go test names. It automatically validates test naming compliance across your codebase, eliminating manual reviews and ensuring consistency before code review.

Can I automate linting and code quality checks for Go projects?

Yes. This Skill integrates automated linting reminders via `make lint-fix` and `make verify` commands, plus codespell validation for Markdown files. It catches formatting issues and spelling errors automatically, preventing CI/CD failures.

What's the best way to meet HyperShift's Go code quality standards?

This Skill enforces HyperShift's strict formatting and test-naming standards automatically. It reminds you to run linting and verification steps, ensuring your Go code and tests meet project conventions before commit.

Do I need to manually check test names every time I write Go tests?

No. This Skill validates test names against the mandatory 'When...it should...' format automatically, eliminating manual checks and reducing rework during code review cycles.

How does this handle Markdown spelling verification?

The Skill reminds you to run `make verify-codespell` for Markdown files, automating spelling validation alongside Go test and code formatting checks for complete quality assurance.