Skip to content

Commit

Permalink
initial linting and pre-commit content
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Broch <kbroch@rivosinc.com>
  • Loading branch information
kbroch-rivosinc committed Jan 20, 2024
1 parent 0853d07 commit 2869464
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions book_header.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,25 @@ This document is released under a Creative Commons Attribution 4.0 International

//the colophon allows for a section after the preamble that is part of the frontmatter and therefore not assigned a page number.
include::colophon.adoc[]

//While some documents need several levels of introductory material, other documents only need a breif introduction. You can choose to have either colophon or an overview, or to have both.
//include::overview.adoc[]
include::authoring.adoc[]

include::a_few_basics.adoc[]

include::tables_graphics.adoc[]

include::blocks_notes_markers.adoc[]

include::wavedrom_edit.adoc[]

include::writing.adoc[]

include::linting.adoc[]

//please note that the index must precede the bibliography for both to work within the same book.
include::index.adoc[]

include::bibliography.adoc[]

14 changes: 14 additions & 0 deletions linting.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
== Linting

The linting of code/documentation can be categorized as dealing with formatting, syntax, or semantics. Once the rules for a given project are defined, many of these rules can be checked automatically with tooling.

=== Tooling

link:https://pre-commit.com/[pre-commit tool] is a very useful, open source, well maintained, and popular tool/framework to help automate linting checks in general. It provides some of the following key features:

* link:https://pre-commit.com/hooks.html[a great number of support hooks for linting]
** including direct support by many of the maintainers of best in class linters (ex: link:https://github.com/psf/black[python linter black])
** link:https://pre-commit.com/index.html#plugins[hook plugins] allow adding these and versioning to control updates
* support for link:https://pre-commit.com/index.html#new-hooks[creating new custom hooks easily]
* can be run before `git commit` (i.e. "pre-commit") so authors can detect and fix problems sooner in the workflow
* can also be run in link:https://pre-commit.com/index.html#github-actions-example[continuous integration (CI)] to enforce checks are run for every pull request

0 comments on commit 2869464

Please sign in to comment.