CTAN
Comprehensive TeX Archive Network

Direc­tory support/hook-pre-commit-pkg

README
Pre-commit hook for LaTeX package developers


=== What it is ?
A pre-commit hook to check basic LaTeX syntax for developer of package.

==== How to install
Copy pre-commit in the .git/hooks file
Add execution right (chmod +x)
Enjoy !

====Checked files
    - .sty
    - .dtx
    - .bbx
    - .cbx
    - .lbx

====What are checked
Only for new line, these properties are checked:
    - All line must finish by a %, without space before.
    Empty line are allowed, but not line with blank space.
    - \begin{macro} and \end{macro} must be paired.
    - \begin{macrocode} and \end{macrocode} must be paired.
    - \begin{macro} must have a second argument.
    - 1 space must be printed between % and \begin{macro} of \end{macro}. % Must be the first line character.
    - 4 spaces must be printed between % and \begin{macrocode} or \end{macrocode}.
    - \cs argument must NOT start by an \

=== Licence and copyright
Maïeul Rouquette 2014-....
v 1.1.2
Licence GPl3 https://www.gnu.org/licenses/gpl-3.0.txt

=== Help and github repository
https://github.com/maieul/git-hooks
Open an issue for any needs.


Down­load the con­tents of this pack­age in one zip archive (3.4k).

hook-pre-com­mit-pkg – Pre-com­mit git hook for pack­age de­vel­op­pers

This pack­age pro­vides a pre-com­mit git hook to check ba­sic syn­tax for the use of pack­age de­vel­op­ers.

It is in­stalled by copy­ing it into the .git/.hooks file.

It then checks the fol­low­ing file types: .sty, .dtx, .bbx, .cbx, and .lbx.

List of per­formed checks:

  • Each line must be ter­mi­nated by a %, with­out a space be­fore it. Empty lines are al­lowed, but not lines with noth­ing but spaces in them.
  • \be­gin{macro} and \end{macro} must be paired.
  • \be­gin{macrocode} and \end{macrocode} must be paired.
  • \be­gin{macro} must have a sec­ond ar­gu­ment.
  • One space must be printed be­tween % and \be­gin{macro} or \end{macro}. % must be the first char­ac­ter in the line.
  • Four spaces must be printed be­tween % and \be­gin{macrocode} or \end{macrocode}.
  • \cs ar­gu­ment must not start with a back­slash.

Pack­agehook-pre-com­mit-pkg
Re­pos­i­toryhttps://github.com/maieul/git-hooks
Ver­sion1.1.2
Li­cense GNU Gen­eral Public Li­cense, ver­sion 3
Copy­right2014–2016 Maïeul Rou­quette
Main­tainer Maïeul Rou­quette
Con­tained inTeX Live as hook-pre-com­mit-pkg
Topics sup­port for pack­age de­vel­op­ment
...
Guest Book Sitemap Contact Contact Author