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
- Host: GitHub
- URL: https://github.com/fionn/newline-linter
- Owner: fionn
- Created: 2024-03-31T19:34:59.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-16T15:46:28.000Z (9 months ago)
- Last Synced: 2025-02-28T20:12:30.006Z (3 months ago)
- Topics: ci, git-subcommand, github-actions, no-newlines
- Language: Shell
- Homepage: https://github.com/marketplace/actions/newline-linter
- Size: 6.84 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.