From b451d1208f35fbeac65a78d89af6ab79d797280e Mon Sep 17 00:00:00 2001 From: Danila Danko Date: Sun, 14 Jan 2024 04:56:38 +0300 Subject: [PATCH] refactor: extend docs - include link to pattern docs - show how to exclude a file --- README.md | 6 +++++- action.yml | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 401fe73..5849e72 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,11 @@ Here's a more complicated example that shows more options being used: # release of fourmolu will be used. version: "0.13.0.0" - # Only check the format of .hs in the src/ directory. + # Only check the format of .hs in the src/ directory + # except src/Main.hs. pattern: | src/**/*.hs + !src/Main.hs # Don't follow symbolic links to .hs files. follow-symbolic-links: false @@ -86,6 +88,8 @@ Here's a more complicated example that shows more options being used: extra-args: "--indent-wheres true" ``` +See [docs](https://github.com/actions/toolkit/tree/main/packages/glob#patterns) on pattern syntax. + ### Example usage with build matrix If you are using a build matrix, then it is more efficient to have a diff --git a/action.yml b/action.yml index 540d545..c16d391 100644 --- a/action.yml +++ b/action.yml @@ -3,9 +3,19 @@ description: 'Check formatting of Haskell code with Fourmolu' inputs: pattern: required: false - description: > - Glob pattern that are used to find source files to format. It is - possible to specify several patterns by putting each on a new line. + description: | + Glob pattern that is used to find source files to format. + + See [docs](https://github.com/actions/toolkit/tree/main/packages/glob#patterns) on pattern syntax. + + It is possible to specify several patterns by putting each one on a new line. + + ```yaml + src/**/*.hs + !src/Main.hs + ``` + + `src/Main.hs` will be skipped. default: | **/*.hs **/*.hs-boot