lint

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 5 Imported by: 0

README

github.com/cccteam/ccc/lint

This package provides custom linting rules for CCC projects. The install-ccc-linter utility builds and installs a custom golangci-lint binary with CCC's custom linters integrated.

Prerequisites

  • Make sure golangci-lint is installed, but VS Code should already have this taken care of

Setup

  1. Install the install-ccc-linter utility.
go install github.com/cccteam/ccc/lint/cmd/install-ccc-linter@latest
  1. Make sure your $GOPATH/bin is included in your $PATH.

  2. Run the install-ccc-linter utility:

install-ccc-linter

You can also specify specific versions if needed:

# Specify plugin version
install-ccc-linter --plugin-version v0.0.3

# Specify both plugin and golangci-lint versions
install-ccc-linter --plugin-version v0.0.3 --golangci-lint-version v2.5.0
  1. Add a custom section to the linters-settings section of the project's .golangci.yml as shown below.
linters:
  ...
  settings:
    ...
    custom:
      ccclint:
        type: module
        description: CCC custom linter
  1. Update your project to use golang-ci.yml@v5.13.0 or greater and make sure golangci-lint-version is 'v2.4' or later. You can also set the ccclint-version.
golang-ci:
  uses: cccteam/github-workflows/.github/workflows/golang-ci.yml@v5.13.0
  with:
    build-tags: '["", "dev"]'
    golangci-lint-version: 'v2.4'
    ccclint-version: 'v0.0.3'
  1. Ensure VSCode is configured to use the linter golangci-lint-v2.

  2. Update your project's readme with the steps to install the lint plugin: Note: This should only need to be done at most every time you change your go version.

go install github.com/cccteam/ccc/lint/cmd/install-ccc-linter@latest
install-ccc-linter

Documentation

Overview

Package lint is a custom linter for custom ccc lint rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(settings any) (register.LinterPlugin, error)

New creates a new instance of the CCCLint plugin.

Types

type CCCLint

type CCCLint struct {
	// contains filtered or unexported fields
}

CCCLint is the main struct for the ccc/lint plugin.

func (*CCCLint) BuildAnalyzers

func (c *CCCLint) BuildAnalyzers() ([]*analysis.Analyzer, error)

BuildAnalyzers builds the analyzers for the CCCLint plugin.

func (*CCCLint) GetLoadMode

func (c *CCCLint) GetLoadMode() string

GetLoadMode returns the load mode for the CCCLint plugin.

type Settings

type Settings struct {
}

Settings holds the configuration for the CCCLint linter.

Directories

Path Synopsis
cmd
install-ccc-linter command
Command install-ccc-linter installs the ccc-lint golangci-lint plugin.
Command install-ccc-linter installs the ccc-lint golangci-lint plugin.
Package errwrap defines a linter that checks if error wrapping has the correct function name.
Package errwrap defines a linter that checks if error wrapping has the correct function name.
Package otelspanname defines a linter that checks if OpenTelemetry span names match function names.
Package otelspanname defines a linter that checks if OpenTelemetry span names match function names.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL