islint

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: GPL-3.0 Imports: 9 Imported by: 0

README

islint

Intermediate Schema linter. What is linting?

Documentation on godoc.org.

Linux 64-bit toy: ...

Usage

$ islint <(zcat file.is.gz)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EarliestDate is the earliest publication date we accept.
	EarliestDate = time.Date(1458, 1, 1, 0, 0, 0, 0, time.UTC)
	// LatestDate represents the latest publication date we accept.
	LatestDate = time.Now().AddDate(5, 0, 0)

	// AllowedCollections
	AllowedCollections = assetutil.MustLoadStringSet("assets/collections/collections.tsv",
		"assets/collections/crossref.tsv")
)

Functions

func AllowedCollectionNames

func AllowedCollectionNames(is finc.IntermediateSchema) error

AllowedCollectionNames checks for a fixed list of allowed collection names, stored under assets, refs. #6496.

func KeyLength

func KeyLength(is finc.IntermediateSchema) error

KeyLength checks the length of the record id. memcachedb limits this to 250 bytes.

func NoCurrencyInTitle

func NoCurrencyInTitle(is finc.IntermediateSchema) error

NoCurrencyInTitle, e.g. http://goo.gl/HACBcW Cartier , Marie . Baby, You Are My Religion: Women, Gay Bars, and Theology Before Stonewall . Gender, Theology and Spirituality. Durham, UK: Acumen, 2013. xii+256 pp. $90.00 (cloth); $29.95 (paper).

func NoExcessivePuctuation

func NoExcessivePuctuation(is finc.IntermediateSchema) error

NoExcessivePuctuation should detect things like this title: CrossRef????????????? https://goo.gl/AD0V1o

func PlausibleDate

func PlausibleDate(is finc.IntermediateSchema) error

PlausibleDate checks for suspicious dates, refs. #5686.

func PlausiblePageCount

func PlausiblePageCount(is finc.IntermediateSchema) error

PlausiblePageCount checks, wether the start and end page look plausible.

func SubtitleRepetition

func SubtitleRepetition(is finc.IntermediateSchema) error

SubtitleRepetition, refs #6553.

func ValidURL

func ValidURL(is finc.IntermediateSchema) error

ValidURL checks, if a URL string is parseable.

Types

type DelegatingRecordTester

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

DelegatingRecordTester delegates testing to a passed in function.

func (DelegatingRecordTester) TestRecord

TestRecord fulfills the interface.

type Kind

type Kind int
const (
	KeyTooLong Kind = iota
	InvalidStartPage
	InvalidEndPage
	EndPageBeforeStartPage
	InvalidURL
	SuspiciousPageCount
	PublicationDateTooEarly
	PublicationDateTooLate
	InvalidCollection
	RepeatedSubtitle
	CurrencyInTitle
	ExcessivePuctuation
)

func (Kind) String

func (i Kind) String() string

type QualityIssue

type QualityIssue struct {
	Kind    Kind
	Record  finc.IntermediateSchema
	Message string
}

func (QualityIssue) Error

func (e QualityIssue) Error() string

func (QualityIssue) TSV

func (e QualityIssue) TSV() string

type RecordTester

type RecordTester interface {
	TestRecord(finc.IntermediateSchema) error
}

RecordTester is a intermediate record checker.

func RecordTesterFunc

func RecordTesterFunc(tester func(finc.IntermediateSchema) error) RecordTester

RecordTesterFunc turns any function into a RecordTester. TODO(miku): convert RecordTesterFunc to type

type TestSuite

type TestSuite []RecordTester

TestSuite is a group of tests.

Directories

Path Synopsis
cmd
islint command

Jump to

Keyboard shortcuts

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