<commit_before>Dogma
=====

<img src="https://raw.github.com/lpil/dogma/master/docs/for-shame.png" alt="FOR SHAME!" title="SHAME" align="right"/>

[![Build Status](https://travis-ci.org/lpil/dogma.svg?branch=master)](https://travis-ci.org/lpil/dogma)
[![Coverage](https://coveralls.io/repos/lpil/dogma/badge.svg)](https://coveralls.io/r/lpil/dogma)
[![Inline docs](https://inch-ci.org/github/lpil/dogma.svg?branch=master&style=flat)](http://inch-ci.org/github/lpil/dogma)


Dogma is a principle or set of principles laid down by an authority as
**incontrovertibly true**.

It's also a code style linter for Elixir, powered by shame.

* [Usage](#usage)
* [Configuration][config-doc]
* [Rules][rules-doc]


[rules-doc]: https://github.com/lpil/dogma/blob/master/docs/rules.md
[config-doc]: https://github.com/lpil/dogma/blob/master/docs/configuration.md


## Usage

Add Dogma to your Mix dependencies

```elixir
# mix.exs
def deps do
  [
    {:dogma, "~> 0.0", only: :dev},
  ]
end
```

Run the mix task:

```
mix dogma
```

You'll get something like this:

```
Inspecting 27 files.

.....X..........X..........

27 files, 2 errors!

== lib/dogma/rules.ex ==
23: TrailingBlankLines: Blank lines detected at end of file

== test/dogma/formatter_test.exs ==
9: TrailingWhitespace: Trailing whitespace detected [33]
```

How handy!

### Formatters

You can pass a format to the mix task using the `--format` flag.

```
> mix dogma --format=flycheck

lib/dogma/rules.ex:23:1: W: Blank lines detected at end of file
test/dogma/formatter_test.exs:9:1: W: Trailing whitespace detected
```

A complete list of available formatters can be found at
[`docs/formatters.md`][formatters-doc]

[formatters-doc]: https://github.com/lpil/dogma/blob/master/docs/formatters.md

## Contributor Information

### Test it

```sh
mix test       # Run tests once
mix test.watch # Run tests on file changes
mix dogma      # Dogfooding- run the linter!
```

### Read the developer docs

Check them out on [hexdocs][hexdocs-dogma], or generate them yourself:

[hexdocs-dogma]: http://hexdocs.pm/dogma/overview.html

```sh
mix docs
```

<commit_msg>Add formatter docs to README contents<commit_after>Dogma
=====

<img src="https://raw.github.com/lpil/dogma/master/docs/for-shame.png" alt="FOR SHAME!" title="SHAME" align="right"/>

[![Build Status](https://travis-ci.org/lpil/dogma.svg?branch=master)](https://travis-ci.org/lpil/dogma)
[![Coverage](https://coveralls.io/repos/lpil/dogma/badge.svg)](https://coveralls.io/r/lpil/dogma)
[![Inline docs](https://inch-ci.org/github/lpil/dogma.svg?branch=master&style=flat)](http://inch-ci.org/github/lpil/dogma)


Dogma is a principle or set of principles laid down by an authority as
**incontrovertibly true**.

It's also a code style linter for Elixir, powered by shame.

* [Usage](#usage)
* [Configuration][config-doc]
* [Rules][rules-doc]
* [Output formats][formatters-doc]

[config-doc]: https://github.com/lpil/dogma/blob/master/docs/configuration.md
[rules-doc]: https://github.com/lpil/dogma/blob/master/docs/rules.md
[formatters-doc]: https://github.com/lpil/dogma/blob/master/docs/formatters.md


## Usage

Add Dogma to your Mix dependencies

```elixir
# mix.exs
def deps do
  [
    {:dogma, "~> 0.0", only: :dev},
  ]
end
```

Run the mix task:

```
mix dogma
```

You'll get something like this:

```
Inspecting 27 files.

.....X..........X..........

27 files, 2 errors!

== lib/dogma/rules.ex ==
23: TrailingBlankLines: Blank lines detected at end of file

== test/dogma/formatter_test.exs ==
9: TrailingWhitespace: Trailing whitespace detected [33]
```

How handy!


## Contributor Information

### Test it

```sh
mix test       # Run tests once
mix test.watch # Run tests on file changes
mix dogma      # Dogfooding- run the linter!
```

### Read the developer docs

Check them out on [hexdocs][hexdocs-dogma], or generate them yourself:

[hexdocs-dogma]: http://hexdocs.pm/dogma/overview.html

```sh
mix docs
```


{'fraction_non_alphanumeric': 0.17465145754119138, 'fraction_numerical': 0.007351077313054499, 'mean_word_length': 4.046035805626598, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2381790', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1402, 'n_words': 337}