Skip to content

exclude and files filters #1470

Description

@luiscachog

Hello,

I have this project layout:

.
├── data
├── defaults
├── docs
├── etc
├── inventories
├── output
├── playbooks
├── plugins
├── roles
├── scripts
├── templates
├── terraform
├── tests
└── vars

I want to configure exclude and files as:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v2.4.0
  hooks:
  - id: trailing-whitespace
  - id: end-of-file-fixer
  - id: check-yaml
  - id: check-added-large-files
- repo: https://github.com/psf/black
  rev: 19.10b0
  hooks:
    - id: black

files: |
  ^defaults/
  ^docs/
  ^etc/
  ^inventories/
  ^roles/
  ^scripts/
  ^templates/
  ^terraform/
  ^tests/
  ^vars/
   * #For all the files on root directory

exclude: |
  ^data/
  ^output/
  ^plugins/

But filter it is not working that way.

What is the correct way to perform that filtering?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions