Skip to content

fionn/newline-linter

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Newline Linter

3.206 Line
A sequence of zero or more non-<newline> characters plus a terminating <newline> 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

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

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

See this repository's workflow for a more complete example.