diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0f410d..4a3992a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,6 @@ +--- name: 'Release' + on: push: branches: [master] @@ -8,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Check out Git repository' - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: 'Generate shell files' run: make generate diff --git a/.github/workflows/pre_commit.yaml b/.github/workflows/pre_commit.yaml new file mode 100644 index 0000000..2aa217e --- /dev/null +++ b/.github/workflows/pre_commit.yaml @@ -0,0 +1,26 @@ +--- +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Install pre-commit + run: pip install pre-commit + + - name: cache + uses: actions/cache@v2 + with: + key: pre-commit-dot-cache-{{ checksum ".pre-commit-config.yaml" }} + path: ~/.cache/pre-commit + + - name: Pre-commit checks + run: pre-commit run --all-files --show-diff-on-failure diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..32694a7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +--- +repos: + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: check-merge-conflict + - id: end-of-file-fixer + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + + - repo: https://github.com/executablebooks/mdformat + rev: 0.7.13 + hooks: + - id: mdformat + additional_dependencies: + - mdformat-gfm + - mdformat-toc + +# EOF diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f50686d..d5771f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,5 +7,5 @@ The following is a set of guidelines for contributing to LS_COLORS ## Pull Request Process 1. Add the new file extension and its color to [`LS_COLORS`](./LS_COLORS). Try to find the most appropriate category for the file type and match the style to the others in the same category. -2. Run tests -3. Create a new pull request +1. Run tests +1. Create a new pull request diff --git a/README.markdown b/README.markdown index 88f5cb6..37518ca 100644 --- a/README.markdown +++ b/README.markdown @@ -1,12 +1,19 @@ -### Table of contents -* [LS_COLORS](#ls_colors) -* [What does it look like?](#what-does-it-look-like) -* [Dependencies](#dependencies) -* [Installation](#installation) -* [Information for Developers](#information-for-developers) -* [Legal](#legal) - # LS_COLORS + +![Build](https://github.com/trapd00r/LS_COLORS/actions/workflows/build.yaml/badge.svg) + + + +- [LS_COLORS](#ls_colors) + - [What does it look like?](#what-does-it-look-like) + - [Dependencies](#dependencies) + - [Installation](#installation) + - [Arch Linux](#arch-linux) + - [Information for Developers](#information-for-developers) + - [Legal](#legal) + + + This is a collection of extension:color mappings, suitable to use as your `LS_COLORS` environment variable. Most of them use the extended color map, described in the ECMA-48 document; in other words, you'll need a terminal @@ -25,33 +32,31 @@ For files that usually ends up next to each other, like html, css and js, try to pick colors that fits in nicely together. Filetypes with multiple possible extensions, like htm and html, should have the same color. -# What does it look like? +## What does it look like? + Here's a screenshot _(font and minor color shades, of course, depend on terminal and its configuration)_: ![Screenshot1](docs/static/LS_COLORS.png) - [0]: https://github.com/trapd00r/zsh-syntax-highlighting-filetypes - [1]: https://github.com/trapd00r/File-LsColor - [2]: https://github.com/trapd00r/File-LsColor/tree/master/bin - [3]: https://aur.archlinux.org/packages/lscolors-git - -# Dependencies +## Dependencies You need GNU `dircolors` and a compatible directory listing tool, such as GNU `ls`. Both are available in GNU coreutils. -# Installation +## Installation The repo contains two compiled scripts `lscolors.sh` & `lscolors.csh`, which you can download & source directly or point your plugin manager to pick up one of them. To enable the colors, add the following line to your shell's start-up script: For Bourne shell (e.g. `~/.bashrc` or `~/.zshrc`): + ``` source ~/path/to/lscolors.sh ``` For C shell (e.g. `~/.cshrc`): + ``` source ~/path/to/lscolors.csh ``` @@ -71,15 +76,18 @@ For C shell (e.g. ~/.cshrc): $ ``` -## Arch Linux +### Arch Linux + Arch Linux users can install the [`lscolors-git`][3] package from the AUR for easy integration with bash, csh, or zsh. -# Information for Developers +## Information for Developers + There's a [library][1] I've written that lets you use various LS COLORS on arbitrary files and directories. A simple implementation can be found [here][2]. Using this, you can do + ```shell find $HOME -maxdepth 1 | ls_color @@ -88,7 +96,8 @@ mpc search artist Laleh | ls_color ... and so on. -# Legal +## Legal + © Copyright 2014-2022 Magnus Woldrich. This program is distributed in the hope that it will be useful, but WITHOUT ANY @@ -101,3 +110,7 @@ either version 1.0 of the License, or (at your option) any later version. You should have received a copy of the Perl Artistic License along with this program. If not, see . + +[1]: https://github.com/trapd00r/File-LsColor +[2]: https://github.com/trapd00r/File-LsColor/tree/master/bin +[3]: https://aur.archlinux.org/packages/lscolors-git