Commit bc1c5220 authored by nimrod's avatar nimrod
Browse files

Migration.

- Common pre-commit config from snippet.
- Migrate from Travis CI to GitLab CI.
- Convert README from reStructuredtext to markdown.
parent 2765b1d2
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+4 −0
Changes for .gitlab-ci.yml: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
---
include:
  - project: shore/ci-templates
    file: templates/pre-commit.yml
+37 −3
Changes for .pre-commit-config.yaml: 37 added lines, 3 removed lines.
Original line number Diff line number Diff line
---
repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v1.3.0
  - repo: https://github.com/pre-commit/pre-commit-hooks.git
    rev: v3.4.0
    hooks:
      - id: check-added-large-files
    -   id: check-yaml
      - id: check-executables-have-shebangs
      - id: check-merge-conflict
      - id: check-symlinks
      - id: trailing-whitespace

  - repo: https://github.com/Yelp/detect-secrets
    rev: v0.14.3
    hooks:
      - id: detect-secrets

  - repo: https://github.com/adrienverge/yamllint
    rev: v1.25.0
    hooks:
      - id: yamllint

  - repo: https://github.com/amperser/proselint/
    rev: 0.10.2
    hooks:
      - id: proselint
        types: [plain-text]
        exclude: LICENSE

  - repo: https://github.com/executablebooks/mdformat.git
    rev: 0.5.3
    hooks:
      - id: mdformat

  - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git
    rev: v0.6.0
    hooks:
      - id: shell-lint

  - repo: https://github.com/shellcheck-py/shellcheck-py.git
    rev: v0.7.1.1
    hooks:
      - id: shellcheck

  - repo: https://github.com/pre-commit/pre-commit.git
    rev: v2.9.3
    hooks:
      - id: validate_manifest

.travis.yml

deleted100644 → 0
+0 −20
Changes for .travis.yml: 0 added lines, 20 removed lines.
Original line number Diff line number Diff line
---
language: python
python: "3.6"
dist: trusty
sudo: false
group: beta
cache:
  - pip
  - directories:
      - $HOME/.cache/

install:
  - pip install pre_commit | cat

script:
  - pre-commit run --all-files

notifications:
  on_failure: never
  email: false

README.md

0 → 100644
+31 −0
Changes for README.md: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Shell pre-commit hooks

[![pipeline status](https://git.shore.co.il/nimrod/shell-pre-commit/badges/master/pipeline.svg)](https://git.shore.co.il/nimrod/shell-pre-commit/-/commits/master)

Shell [pre-commit](http://pre-commit.com/) hooks.

## Usage

Add the following to your `.pre-commit-config.yaml`:

```yaml
- repo: https://git.shore.co.il/nimrod/shell-pre-commit.git
  sha: v0.6.0
  hooks:
    - id: shell-lint
    - id: shellcheck
```

The minimal pre-commit version required is 0.15.0. The `shellcheck` hook
requires [shellcheck](https://www.shellcheck.net/) installed.

## License

This software is licensed under the MIT license (see `LICENSE.txt`).

## Author Information

Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my
[website](https://www.shore.co.il/). Patches are welcome via
[`git send-email`](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository
is located at: <https://git.shore.co.il/expore/>.

README.rst

deleted100644 → 0
+0 −51
Changes for README.rst: 0 added lines, 51 removed lines.
Original line number Diff line number Diff line
Shell pre-commit hooks
######################

.. image:: https://travis-ci.org/adarnimrod/shell-pre-commit.svg?branch=master
    :target: https://travis-ci.org/adarnimrod/shell-pre-commit

Shell `pre-commit <http://pre-commit.com/>`_ hooks.

Hooks
-----

- :code: `shell-lint` - Runs :code:`/bin/sh -en` against identified shell
  scripts.
- :code: `shellcheck` - Runs `shellcheck
  <https://github.com/koalaman/shellcheck/>`_ agains identified shell scripts.

Dependencies
------------

- :code: `/bin/sh`
- :code: `shellcheck`
- Pre-commit 0.15.0 or later.

Installation
------------

Add the following to your :code:`.pre-commit-config.yaml`:

.. code:: yaml

    - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git
      sha: v0.6.0
      hooks:
      - id: shell-lint
      - id: shellcheck

And run :code:`pre-commit autoupdate` to update the hooks.

License
-------

This software is licensed under the MIT license (see the :code:`LICENSE.txt`
file).

Author Information
------------------

Nimrod Adar, `contact me <nimrod@shore.co.il>`_ or visit my `website
<https://www.shore.co.il/>`_. Patches are welcome via `git send-email
<http://git-scm.com/book/en/v2/Git-Commands-Email>`_. The repository is located
at: https://git.shore.co.il/.