Skip to content

Quality Control

Rintze M. Zelle edited this page Jan 28, 2015 · 14 revisions

We love the CSL style repository, and try keep it in tip-top shape. Since we have thousands of styles and hundreds of contributors, we rely heavily on automated quality control and periodic maintenance. This page describes our best practices.

Forks and Pull Requests

preferably fork, branch, and create pull requests

Travis CI

godsend, checks repo and all incoming pull requests

Indentation, Ordering, and Escaping

https://github.com/citation-style-language/utilities/blob/master/csl-reindenting-and-info-reordering.py

Extra-strict Validation

csl-repository.rnc

Repairing Problematic Code Patterns

Here we keep track of problematic CSL code patterns we have observed in the wild, and provide information on how they can be detected and corrected.

Spaces if second field is flushed

If the second field in the bibliography is flushed, then it should not have a space as a prefix.

Search patterns

<bibliography[^>]*second-field-align="flush"[^>]*>.*<layout[^>]*>\r\n\s*<text variable="citation-number"[^>]*/>\r\n\s*<text[^>]*prefix=" "

Fix

Delete prefix=" " by hand, but it seems possible to automatically delete the last prefix attribute in this pattern. No, critical case found. Moreover, no case with a different prefix beginning with a space found.

History

2015-01: #1349 and #1346 : ca. 39 matches

Adjacent spaces from suffix and prefix

Search Pattern

<[^/>]*suffix="[^"/>]* "[^/>]*/?>\s*\r\n\s*<[^/>]*prefix=" [^"/>]*"[^/>]*/?>

Fix

Manually look at every case and either (i) delete the space in suffix, (ii) delete the space in the prefix, (iii) use a group with delimiter=" ", or (iv) rewritte some parts of the style. This can take some time in order to not change the punctation. It may be possible to restrict the search pattern more, in order to obtain smaller sets of the same/similar replacements.

History

2015-01: #1301 : ca. 300 hits in 230 files

Clone this wiki locally