{"id":29017772,"url":"https://github.com/fornever/verifyencoding","last_synced_at":"2025-06-25T23:06:36.646Z","repository":{"id":276541185,"uuid":"929570741","full_name":"ForNeVeR/VerifyEncoding","owner":"ForNeVeR","description":"A script to verify text file encodings in a repository","archived":false,"fork":false,"pushed_at":"2025-04-08T00:29:27.000Z","size":20,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T00:30:12.208Z","etag":null,"topics":["ci","encoding"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","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/ForNeVeR.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-08T21:16:37.000Z","updated_at":"2025-04-08T00:24:36.000Z","dependencies_parsed_at":"2025-03-16T23:30:26.253Z","dependency_job_id":null,"html_url":"https://github.com/ForNeVeR/VerifyEncoding","commit_stats":null,"previous_names":["fornever/encoding-verifier","fornever/verifyencoding"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ForNeVeR/VerifyEncoding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FVerifyEncoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FVerifyEncoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FVerifyEncoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FVerifyEncoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ForNeVeR","download_url":"https://codeload.github.com/ForNeVeR/VerifyEncoding/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FVerifyEncoding/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261967132,"owners_count":23237663,"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":["ci","encoding"],"created_at":"2025-06-25T23:06:35.935Z","updated_at":"2025-06-25T23:06:36.633Z","avatar_url":"https://github.com/ForNeVeR.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2025 VerifyEncoding contributors \u003chttps://github.com/ForNeVeR/VerifyEncoding\u003e\n\nSPDX-License-Identifier: MIT\n--\u003e\n\nVerifyEncoding [![Status Terrid][status-terrid]][andivionian-status-classifier] [![PowerShell Gallery Version][badge.powershell-gallery]][install.powershell-gallery]\n==============\nThis is a script to verify file encodings. It will ensure that none text files in the repository (identified as text by Git) have `\\r\\n` line endings or UTF-8 BOM attached to them.\n\nUsage\n-----\n### Installation\n#### Option 1: PowerShell Gallery\n[Install the module from the PowerShell Gallery][install.powershell-gallery]:\n```console\n$ Install-Module VerifyEncoding -Repository PSGallery -Scope CurrentUser\n```\n\nThen use as a PowerShell function:\n```\n$ Import-Module VerifyEncoding\n$ Test-Encoding [[-SourceRoot] \u003cSourceRoot\u003e] [-Autofix] [[-ExcludeExtensions] \u003cString[]\u003e]\n```\n\n#### Option 2: Quick Script Deployment\nCopy the `VerifyEncoding/Test-Encoding.ps1` script to your repo (or get from [the Releases section][releases]),\nthen use from any shell as\n```console\n$ pwsh Test-Encoding.ps1 [[-SourceRoot] \u003cSourceRoot\u003e] [-Autofix] [[-ExcludeExtensions] \u003cString[]\u003e]\n```\n\n#### Option 3: Deploy Module From Sources\nEither clone the sources or download the latest module archive from [the Releases section][releases],\nand then run the following PowerShell commands:\n```console\n$ Import-Module ./VerifyEncoding/VerifyEncoding.psd1\n$ Test-Encoding [[-SourceRoot] \u003cSourceRoot\u003e] [-Autofix] [[-ExcludeExtensions] \u003cString[]\u003e]\n```\n\n### Parameters\n- `SourceRoot` is the directory where the script will look for the files. By default (if nothing's passed), the script will try auto-detecting the nearest Git root.\n- `-Autofix` will apply fixes to all the problematic files.\n- `-ExcludeExtensions` allows passing an array of file extensions (case-insensitive) that will be ignored during the check. The default list is `@('.dotsettings')`\n\n### CI\nAdd the following block to your CI script (here I'll use GitHub Actions, but it's possible to adapt to any other CI provider):\n```yaml\njobs:\n  encoding:\n    runs-on: ubuntu-latest # or any other runner that has PowerShell installed\n    steps:\n    # […]\n    - name: Verify encoding\n      shell: pwsh\n      run: Install-Module VerifyEncoding -Repository PSGallery -RequiredVersion 2.2.0 -Force \u0026\u0026 Test-Encoding \u003cparameters go here\u003e\n```\nThis command will generate a non-zero exit code in case there's a validation error and list all the files with issues.\n\n#### Renovate\nIf you use [Renovate][renovate] to automatically manage dependencies on CI,\nyou may set it up to update VerifyEncoding as well.\nIf you have the previously recommended `Install-Module` command called in your CI setup script,\nthen add the following into your `renovate.json`, and it will also update VerifyEncoding from the PowerShell Gallery:\n```json\n{\n  \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n  \"extends\": \"...\",\n  \"customManagers\": [\n    {\n      \"customType\": \"regex\",\n      \"fileMatch\": [\n        \"^\\\\.github/workflows/.+\\\\.yml$\"\n      ],\n      \"matchStrings\": [\n        \"Install-Module (?\u003cdepName\u003e\\\\S+?) -RequiredVersion (?\u003ccurrentValue\u003e\\\\S+)\"\n      ],\n      \"datasourceTemplate\": \"nuget\",\n      \"registryUrlTemplate\": \"https://www.powershellgallery.com/api/v2/\"\n    }\n  ]\n}\n```\n\nDocumentation\n-------------\n- [Changelog][docs.changelog]\n- [Contributor Guide][docs.contributing]\n- [Maintainer Guide][docs.maintaining]\n\nLicense\n-------\nThe project is distributed under the terms of [the MIT license][docs.license].\n\nThe license indication in the project's sources is compliant with the [REUSE specification v3.3][reuse.spec].\n\n[andivionian-status-classifier]: https://andivionian.fornever.me/v1/#status-terrid-\n[badge.powershell-gallery]: https://img.shields.io/powershellgallery/v/VerifyEncoding\n[docs.changelog]: CHANGELOG.md\n[docs.contributing]: CONTRIBUTING.md\n[docs.license]: LICENSE.txt\n[docs.maintaining]: MAINTAINING.md\n[install.powershell-gallery]: https://www.powershellgallery.com/packages/VerifyEncoding\n[releases]: https://github.com/ForNeVeR/VerifyEncoding/releases\n[renovate]: https://docs.renovatebot.com/\n[reuse.spec]: https://reuse.software/spec-3.3/\n[status-terrid]: https://img.shields.io/badge/status-terrid-green.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffornever%2Fverifyencoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffornever%2Fverifyencoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffornever%2Fverifyencoding/lists"}