{"id":16215596,"url":"https://github.com/njgibbon/fend","last_synced_at":"2025-04-07T22:40:50.594Z","repository":{"id":57566196,"uuid":"338695589","full_name":"njgibbon/fend","owner":"njgibbon","description":"Check for Newline at File End","archived":false,"fork":false,"pushed_at":"2021-07-16T18:30:20.000Z","size":758,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T20:01:55.167Z","etag":null,"topics":["cli","eof","go","golang","lint","posix","tools","unix"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/njgibbon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-14T00:01:33.000Z","updated_at":"2022-01-31T10:04:47.000Z","dependencies_parsed_at":"2023-01-11T17:23:21.134Z","dependency_job_id":null,"html_url":"https://github.com/njgibbon/fend","commit_stats":{"total_commits":114,"total_committers":1,"mean_commits":114.0,"dds":0.0,"last_synced_commit":"2328783506fb0aa69dcbbe2b0bae25fd0b9d1b13"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njgibbon%2Ffend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njgibbon%2Ffend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njgibbon%2Ffend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njgibbon%2Ffend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/njgibbon","download_url":"https://codeload.github.com/njgibbon/fend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247744127,"owners_count":20988778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","eof","go","golang","lint","posix","tools","unix"],"created_at":"2024-10-10T11:15:27.276Z","updated_at":"2025-04-07T22:40:50.569Z","avatar_url":"https://github.com/njgibbon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fend\nCheck for Newline at **F**ile **End**\n\nFend recursively scans all files in a directory and reports those that don't end in a new line character (`\\n`).\n\n![Fend Passed](images/fend-passed.png)\n\n# Why might you want to do this?\n\nIt is a POSIX Standard that you *should*, *arguably* adhere to.\n\nThis StackOverflow post captures the *why?* better than I could:\n\nhttps://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline\n\nIt will mean no more GitHub warnings for 'No newline at EOF' on Pull Request.\n\n![GitHub EOF No Newline at EOF Warning](images/github-no-newline-eof-warn.png)\n\nBy enforcing this check using the GitHub Action you can automate a basic Standard in your project.\n\nConsistent is clean. Clean is good. Don't overthink it. :ok_hand:\n\n# GitHub Action\nSee [.github/workflows/fend.yaml](.github/workflows/fend.yaml) as the Action is run on this repository!\n\nSee [Configuration](#Configuration) for additonal options.\n```\njobs:\n  fend:\n    name: Fend\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@master\n    - uses: njgibbon/fend@main\n```\n**That's all!** :dizzy:\n\n# Research\nRunning Fend on some well known repositories and recording the results!\n\n[docs/research/readme.md](docs/research/readme.md).\n\n# Details\n* Fend always ignores all '.git' directories and non-regular files like symlinks. \n* To skip anything else see [Configuration](#Configuration). You will want to configure the tool to skip any binary file types found in your repository - like any images for instance.\n\n\n# Usage\n```\ngo get -u github.com/njgibbon/fend/cmd/fend\n# ensure binary can be found in $PATH e.g\n# mv ~/go/bin/fend ~/my/bin\ncd \u003cdir-to-scan\u003e\nfend\n```\n**Other**\n```\n# Version of fend\nfend version\n# Doc command points to here\nfend doc\n```\n## Package\nThe scanner component can easily be used as a package. \nSee [cmd/fend/main.go](cmd/fend/main.go) and [pkg/scanner/scanner_test.go](pkg/scanner/scanner_test.go) for usage examples.\n\n# Configuration\nPlace a file called `.fend.yaml` in the working directory to configure your scan. See [.fend.yaml](.fend.yaml) for the configuration used for the fend GitHub Action on *this* repository.\n```\nskip:\n  file: \n    - skip_file.txt\n  file_all: \n    - skip_file_all.txt\n  dir:\n    - skip-dir\n  dir_all:\n    - skip-dir-all\n  extension: \n    - .skip\n    - .ignore\n```\n* You can skip specific files or directories by providing the full path.\n* You can skip all instances of a file or directory.\n* You can skip all files with certain extensions.\nThe Failure Extensions Feature can be used to help you configure a good skip list. See [docs/research/checkov/readme.md](docs/research/checkov/readme.md) for an example of how you can quickly configure the right skips.\n\n# Failed Scan Example\n![Fend Failed](images/fend-failed.png)\n\n# Meta\nProject used as a vehicle to help learn some of the basics of tool development using Go and also to explore GitHub Actions from a development point of view as I have had a really positive experience with GitHub Actions from the user perspective.\n\n# Similar tools\n* https://github.com/fernandrone/linelint\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjgibbon%2Ffend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnjgibbon%2Ffend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjgibbon%2Ffend/lists"}