No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Check the integrity of Democratic Commons data
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 5.0
>= 0
~> 10.0
>= 0
~> 2.0

Runtime

 Project Readme

commons-integrity

Build Status

Usage

Installation

Add to the Gemfile dependencies for a proto-commons- repository:

gem 'commons-integrity', :github => 'everypolitician/commons-integrity'

Configuration

Each check you wish to run within your project should be listed in a configuration file (by default .integrity.yml in the project's root directory, though this can also be specified separately.)

This will usually specify which file(s) to run against, and any options specific to that individual check.

For example:

  WikidataIdentifiers:
    AppliesTo: 'boundaries/**/*.csv'
    column_name: 'WIKIDATA'
    column_case: 'fixed'

Orchestration

Currently you need to create your own script to run this, and choose how to display the errors. We plan to make both of these much simpler.

An example bin/check could do something like:

  require 'commons/integrity'

  root = Pathname.new(ARGV.first || '.')
  files = Pathname.glob(root + '**/*')
  errors = files.map { |file| Commons::Integrity::Report.new(file: file).errors }
  puts errors

Creating new Checks

Add new checks in lib/commons/integrity/check/ such that they look like existing checks.

Each should inherit from Commons::Integrity::Check::Base and supply its own errors method.

Documentation for the Check should be added in YARD format.