vcs-ignore-0.0.1.0: Library for handling files ignored by VCS systems.
Copyright(c) 2020-2021 Vaclav Svejcar
LicenseBSD-3-Clause
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.VCS.Ignore.Repo

Description

This module contains type class representing the selected type of VCS repository.

Synopsis

Documentation

class Repo r where Source #

Type class representing instance of VCS repository of selected type. In order to obtain instance, the physical repository needs to be scanned first by the scanRepo method. Then absolute path to the repository root is provided by repoRoot method. To check if any path (relative to the repo root) is ignored or not, use the isIgnored method.

Methods

repoName Source #

Arguments

:: r

VCS repository instance

-> Text

name of the repository

Returns name of the repository (e.g. GIT).

repoRoot Source #

Arguments

:: r

VCS repository instance

-> FilePath

absolute path to the repository

Returns absolute path to the root of the VCS repository.

scanRepo Source #

Arguments

:: (MonadIO m, MonadThrow m) 
=> FilePath

path to the VCS repository root

-> m r

scanned repository (or failure)

Scans repository at given path. If the given path doesn't contain valid repository, RepoError may be thrown.

isIgnored Source #

Arguments

:: MonadIO m 
=> r

VCS repository instance

-> FilePath

path to check, relative to the repository root

-> m Bool

whether the path is ignored or not

Checks whether the given path is ignored. The input path is expected to be relative to the repository root, it might or might not point to existing file or directory.

Instances

Instances details
Repo Git Source # 
Instance details

Defined in Data.VCS.Ignore.Repo.Git

data RepoError Source #

Represents error related to operations over the VCS repository.

Constructors

InvalidRepo FilePath Text

Given FilePath doesn't contain valid VCS repository root.

Instances

Instances details
Eq RepoError Source # 
Instance details

Defined in Data.VCS.Ignore.Repo

Show RepoError Source # 
Instance details

Defined in Data.VCS.Ignore.Repo

Exception RepoError Source # 
Instance details

Defined in Data.VCS.Ignore.Repo