{"id":15502642,"url":"https://github.com/vaclavsvejcar/vcs-ignore","last_synced_at":"2025-04-22T23:20:36.039Z","repository":{"id":56882053,"uuid":"276220332","full_name":"vaclavsvejcar/vcs-ignore","owner":"vaclavsvejcar","description":"📜 Haskell library handling files ignored by VCS","archived":false,"fork":false,"pushed_at":"2022-06-06T14:45:49.000Z","size":116,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T00:31:00.150Z","etag":null,"topics":["git","haskell","haskell-library","vcs"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaclavsvejcar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-06-30T22:18:34.000Z","updated_at":"2022-09-15T09:15:38.000Z","dependencies_parsed_at":"2022-08-20T13:00:49.840Z","dependency_job_id":null,"html_url":"https://github.com/vaclavsvejcar/vcs-ignore","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaclavsvejcar%2Fvcs-ignore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaclavsvejcar%2Fvcs-ignore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaclavsvejcar%2Fvcs-ignore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaclavsvejcar%2Fvcs-ignore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaclavsvejcar","download_url":"https://codeload.github.com/vaclavsvejcar/vcs-ignore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250338382,"owners_count":21414168,"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":["git","haskell","haskell-library","vcs"],"created_at":"2024-10-02T09:10:33.294Z","updated_at":"2025-04-22T23:20:36.022Z","avatar_url":"https://github.com/vaclavsvejcar.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI](https://github.com/vaclavsvejcar/vcs-ignore/workflows/CI/badge.svg)\n[![Hackage version](http://img.shields.io/hackage/v/vcs-ignore.svg)](https://hackage.haskell.org/package/vcs-ignore)\n[![Stackage version](https://www.stackage.org/package/vcs-ignore/badge/lts?label=Stackage)](https://www.stackage.org/package/vcs-ignore)\n\n# vcs-ignore\n`vcs-ignore` is small Haskell library used to find, check and process files ignored by selected _VCS_.\n\n## 1. Table of Contents\n\u003c!-- TOC --\u003e\n\n- [1. Table of Contents](#1-table-of-contents)\n- [2. Use as Library](#2-use-as-library)\n    - [2.1. Listing all files/directories ignored by VCS](#21-listing-all-filesdirectories-ignored-by-vcs)\n    - [2.2. Walking files/directories ignored by VCS](#22-walking-filesdirectories-ignored-by-vcs)\n    - [2.3. Checking if path is ignored by VCS](#23-checking-if-path-is-ignored-by-vcs)\n- [3. Use as Executable](#3-use-as-executable)\n    - [3.1. Checking if path is ignored by VCS](#31-checking-if-path-is-ignored-by-vcs)\n\n\u003c!-- /TOC --\u003e\n\n\n## 2. Use as Library\nBecause this library is really simple to use, following example should be enough to understand how to use it for your project.\n\n### 2.1. Listing all files/directories ignored by VCS\n```haskell\n{-# LANGUAGE TypeApplications #-}\n\nmodule Data.VCS.Test where\n\nimport Data.VCS.Ignore ( Git, Repo(..), listRepo )\n\nexample :: IO [FilePath]\nexample = do\n  repo \u003c- scanRepo @Git \"path/to/repo\"\n  listRepo repo\n```\n\n### 2.2. Walking files/directories ignored by VCS\n```haskell\n{-# LANGUAGE TypeApplications #-}\n\nmodule Data.VCS.Test where\n\nimport Data.Maybe       ( catMaybes )\nimport System.Directory ( doesFileExist )\nimport Data.VCS.Ignore  ( Git, Repo(..), walkRepo )\n\nonlyFiles :: IO [FilePath]\nonlyFiles = do\n  repo \u003c- scanRepo @Git \"path/to/repo\"\n  catMaybes \u003c$\u003e walkRepo repo walkFn\n where\n  walkFn path = do\n    file \u003c- doesFileExist path\n    pure (if file then Just path else Nothing)\n\n```\n\n### 2.3. Checking if path is ignored by VCS\n```haskell\n{-# LANGUAGE TypeApplications #-}\n\nmodule Data.VCS.Test where\n\nimport Data.VCS.Ignore ( Git, Repo(..) )\n\ncheckIgnored :: IO Bool\ncheckIgnored = do\n  repo \u003c- scanRepo @Git \"path/to/repo\"\n  isIgnored repo \"/some/path/.DS_Store\"\n```\n\n## 3. Use as Executable\nWhile `vcs-ignore` is mainly intended to be used as a library, it also comes with small executable called `ignore` that can be used standalone to verify whether given path is ignored or not.\n\n```\n$ ignore --help\nvcs-ignore, v0.0.2.0 :: https://github.com/vaclavsvejcar/vcs-ignore\n\nUsage: ignore (-p|--path PATH) [--debug] [-v|--version] [--numeric-version]\n  library for handling files ignored by VCS systems\n\nAvailable options:\n  -p,--path PATH           path to check\n  --debug                  produce more verbose output\n  -v,--version             show version info\n  --numeric-version        show only version number\n  -h,--help                Show this help text\n```\n\n### 3.1. Checking if path is ignored by VCS\nTo verify if path is ignored by _VCS_, just call the `ignore` executable with `-p` parameter inside the _VCS_ repository like this:\n\n```\n$ ignore -p .stack-work/some-file\nFound repository at: /path/to/repo\nPath '.stack-work/some-file' IS NOT ignored\n\n$ echo $?\n1\n```\n\nAs you can see, `ignore` executable prints result in human readable form as well as it sets the exit code to `1` if the file is __not__ ignored.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaclavsvejcar%2Fvcs-ignore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaclavsvejcar%2Fvcs-ignore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaclavsvejcar%2Fvcs-ignore/lists"}