An open API service indexing awesome lists of open source software.

https://github.com/fionn/newline-linter

Lint files not ending in newlines
https://github.com/fionn/newline-linter

ci git-subcommand github-actions no-newlines

Last synced: 3 months ago
JSON representation

Lint files not ending in newlines

Awesome Lists containing this project

README

        

# Newline Linter

> **3.206 Line**

> A sequence of zero or more non-\ characters plus a terminating \ character.

## Overview

_No, newline at end of file._

Lint tracked non-binary files that do not end in a newline, either locally with a Git subcommand or in CI with GitHub Actions.

## Git Subcommand

Install `git-no-newlines` in your path and run
```shell
git no-newlines
```
in a Git repository to list non-binary files that do not terminate in a newline.
Setting `EXCLUDE_PATTERN` to an extended-`grep`-compatible pattern will exclude matching files.

## GitHub Action

### Inputs

* `exclusion_pattern`
* Optional extended-`grep`-compatible pattern of filenames to exclude.

### Example

```yml
- name: Lint newlines
uses: fionn/newline-linter@master
with:
exclusion_pattern: intentionally_unterminated_file
```

See [this repository's workflow](.github/workflows/main.yml) for a more complete example.