wawandco / milo

Milo is an HTML linter written in Go
MIT License
20 stars 0 forks source link

Go Report Card

Milo

Milo is a linter tool that will check for both syntax correctness and style recommendations in HTML files. The end goal is to have a single binary that could be used in the context of a CI server which could check the codebase HTML before PR's get merged.

Important Considerations

Installation

You can download the precompiled Milo binary from the releases page.

With Go

If you have Go installed in your system you can build from source:

go install github.com/wawandco/milo/cmd/milo@latest

Github Action

On github you can use Milo action to run in your workflows. For example:

name: Main Workflow
on: [push]
jobs:
  lint:
    name: HTML Linting (Milo)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      # Run the milo 
      - uses: wawandco/milo-action@v0.2.0
        with:
          folder: "templates"
          version: "v0.6.0"

  lint-go:
    ...

See more instructions on the milo-action repo.

Usage

milo review folder_to_analize

Example:

milo review templates
milo review templates/file.html

# It also supports multiple folders or files
milo review templates/file.html templates/another.html other_folder

Configuration

By default Milo will run all the linters it has. However, some teams will want to disable some of the linters in the list, if this is your case you can add a .milo.yml file in the root of your codebase. Once you have installed Milo it can generate that file by running:

milo init

That .milo.yml will look like the following example:

output: text # could be `text`, `github` or `silent`
reviewers:
  - doctype/present 
  - ...

This file will be used by the Milo binary to determine which reviewers to run our files against.

Reviewers

Milo uses the following reviewers:

Head

Tags

Attributes

Inline

Credits

This repo depends heavily in the following libraries that deserve all the credit for making Milo possible:

We copied this in our source because we needed to make some modifications to it. Our goal long term goal is to contribute back as much as possible.

Copyright

Milo is Copyright © 2020 Wawandco SAS. It is free software, and may be redistributed under the terms specified in the LICENSE file.