rubezh

command module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 3 Imported by: 0

README

Rubezh Banner

Rubezh

рубеж — Enforces external test packages in Go

Release GitHub Action Go Reference CI codecov

Rubezh is a Go linter that requires test files to use an external test package whose name ends in _test (for example, package foo_test).

This keeps tests focused on the package's public API instead of its unexported implementation.

Rubezh accepts both Go source files and Go package patterns:

rubezh foo_test.go bar_test.go
rubezh ./...

When no arguments are provided, Rubezh checks ./.... The conventional export_test.go file may use the package under test without the _test suffix.

Configuration

Rubezh automatically loads .rubezh.yaml, .rubezh.yml, or .rubezh.json from the current directory. Use --config (or -c) to specify another file.

Files and packages can be excluded with glob patterns. File patterns are relative to the directory containing the configuration file. Package patterns match either a Go import path or a package name.

exclude:
  files:
    - "**/generated_test.go"
    - "internal/legacy/*_test.go"
  packages:
    - "github.com/example/project/generated/**"
    - "legacy"

The equivalent JSON structure is also supported:

{
  "exclude": {
    "files": ["**/generated_test.go"],
    "packages": ["github.com/example/project/generated/**"]
  }
}

How to install

You can download the latest release from the release page.

If you have Go installed, you can also install Rubezh using the following command:

go install github.com/aethiopicuschan/rubezh@latest

If you want to build Rubezh from source, you can clone the repository and run the following commands:

git clone https://github.com/aethiopicuschan/rubezh.git
cd rubezh
go build -o rubezh

GitHub Actions

Add Rubezh to your workflow after checking out the repository:

name: Rubezh

on:
  pull_request:
  push:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: aethiopicuschan/rubezh@v1

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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