linter-biber

Bibliography linter for biber engine

Benjamin Gray

1,009

0

0.1.0

MIT

GitHub

This package consumes the following services:

linter-biber

Atom linting package for biber.

Should be better than many tools out there (at least has potential to be), because it uses a full parser to read the file. Any linting mistakes should be reported to the issues page, or parsing issues to the parser repo issues page. If in doubt, just report to the linter repo and I'll deal with it.

Inspiration for the kinds of errors and warnings comes from https://github.com/Pezmc/BibLatex-Check/blob/master/biblatex_check.py Largely diverged now I believe.

Requirements

Settings

Currently, the style must be set manually. Any settings changes also require restarting Atom to be applied (including changing config files).

Config

A goal of this package is to automatically generate the rules for a given grammar. This technically works, but many grammars define rules in places I haven't added support for yet. So, for the time being, you will probably need to make use of a config file to fine tune the expected entries and fields for your style.

There are two possible config sources: a global config, applied to all projects, and a local config that is only applied to a specific project.

Note that local config support has not been added yet.

Both these configs use the same syntax. The file itself is a JSON, JS, CSON, or YAML format (or .latexcfg under the key linter-biber; not supported yet though).

At the top level object, there are two optional properties: global and styles. global immediately takes the config settings, while styles is an object where the keys are style names, and the values are config settings for that specific style. E.g. (a YAML example),

global:
  lints:
    - ...
  fields:
    - ...
  entries:
    - ...

styles:
  apa:
    lints:
      - ...
    entries:
      - ...
  oxyear:
    lints:
      - ...

As shown above, the three recognised config keys are lints, fields, and entries (note all are optional). The order of these keys is irrelevant.

In general, the same option keys can be repeated as much as you like in a single command. This is how you might add multiple some conditionals in one command (though you could just split them over several commands if you prefer).

The execution order is as follows:

In conflicts, future commands will override earlier ones.

As an example, here's one that allows the article entry to contain publisher, and converts the requirement of both title and journaltitle to just at least one of them.

global:
  entries:
    - set article {add=publisher}
    - require article {rall=[title, journaltitle], some=[title, journaltitle]}

And again, but in JSON

{
  "global": {
    "entries": [
      "set article {add=publisher}",
      "require article {rall=[title, journaltitle], some=[title, journaltitle]}"
    ]
  }
}

Hopefully, future improvements in style definition parsing will reduce the need to rely on this. It should suffice for now though.

Numbering

The numbers are a mess right now, and will not be permanent. I normally just used the first number I could think of that (probably) hadn't been used somewhere else. All numbers are less than 1000, and you don't need to include the leading 0's when adding rules about watching and ignoring.

With that said, here's a summary of the current lints and their numbers: