recheck

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 8 Imported by: 0

README

recheck

WARNING: β quality code

recheck is a program for validating regular expressions in go programs.

Why?

Currently validity of regular expressions is checked at run time, either by examining returned error of regexp.Compile or having regexp.MustCompile panic (usually in init).

recheck allows you to check your regular expressions at test/lint time. receck examines called to regexp.*Compile* and if the regular expression is a literal string - will check that it's valid.

recheck will also examine lines that have a comment in the following format:

r.HandleFunc("/articles/{category}/{id:[0-9]+}", handler) // recheck:0

Then number after "recheck:" is the argument to check (first one in this case)

Install

go get github.com/tebeka/recheck/cmd/recheck

Documentation

Overview

Package recheck provides a static checker for regular expressions

`receck` examines called to `regexp.*Compile*` and if the regular expression is a literal string - will check that it's valid.

`recheck` will also examine lines that have a comment in the following format:

r.HandleFunc("/articles/{category}/{id:[0-9]+}", handler) // recheck:0

Then number after "recheck:" is the argument to check (first one in this case)

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "recheck",
	Doc:  "Validate regular expressions",
	Run:  run,
}

Analyzer a regular expression analyzer

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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