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: 16 days ago
JSON representation
Lint files not ending in newlines
- Host: GitHub
- URL: https://github.com/fionn/newline-linter
- Owner: fionn
- Created: 2024-03-31T19:34:59.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-10-28T11:38:45.000Z (7 months ago)
- Last Synced: 2026-03-29T21:04:35.353Z (2 months ago)
- Topics: ci, git-subcommand, github-actions, no-newlines
- Language: Shell
- Homepage: https://github.com/marketplace/actions/newline-linter
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.