mirror of https://github.com/citusdata/citus.git
Introduce scripts to sync gitignore rules for .source files
parent
cbbd10b974
commit
c96b439a48
|
@ -64,6 +64,12 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: 'Check if changed'
|
name: 'Check if changed'
|
||||||
command: git diff --exit-code
|
command: git diff --exit-code
|
||||||
|
- run:
|
||||||
|
name: 'Check for gitignore entries .for source files'
|
||||||
|
command: ci/fix_gitignore.sh
|
||||||
|
- run:
|
||||||
|
name: 'Check if changed'
|
||||||
|
command: git diff --exit-code
|
||||||
- run:
|
- run:
|
||||||
name: 'Check for lengths of changelog entries'
|
name: 'Check for lengths of changelog entries'
|
||||||
command: ci/disallow_long_changelog_entries.sh
|
command: ci/disallow_long_changelog_entries.sh
|
||||||
|
|
|
@ -346,3 +346,9 @@ foo = 2
|
||||||
#endif
|
#endif
|
||||||
```
|
```
|
||||||
This was deemed to be error prone and not worth the effort.
|
This was deemed to be error prone and not worth the effort.
|
||||||
|
|
||||||
|
## `fix_gitignore.sh`
|
||||||
|
|
||||||
|
This script makes sure that git ignores the sql files and expected output files
|
||||||
|
that are generated from `.source` template files. If you created or deleted a
|
||||||
|
`.source` file in a commit, git ignore rules should be updated.
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#! /bin/bash
|
||||||
|
# shellcheck disable=SC2012
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
source ci/ci_helpers.sh
|
||||||
|
|
||||||
|
# We list all the .source files in alphabetical order, and do a substitution
|
||||||
|
# before writing the resulting file names that are created by those templates in
|
||||||
|
# relevant .gitignore files
|
||||||
|
#
|
||||||
|
# 1. Capture the file name without the .source extension
|
||||||
|
# 2. Add the desired extension at the end
|
||||||
|
# 3. Add a / character at the beginning of each line to conform to .gitignore file format
|
||||||
|
#
|
||||||
|
# e.g. multi_copy.source -> /multi_copy.sql
|
||||||
|
ls -1 src/test/regress/input | sed -E "s#(.*)\.source#/\1.sql#" > src/test/regress/sql/.gitignore
|
||||||
|
|
||||||
|
# e.g. multi_copy.source -> /multi_copy.out
|
||||||
|
ls -1 src/test/regress/output | sed -E "s#(.*)\.source#/\1.out#" > src/test/regress/expected/.gitignore
|
|
@ -14,3 +14,4 @@ ci/remove_useless_declarations.sh
|
||||||
ci/disallow_c_comments_in_migrations.sh
|
ci/disallow_c_comments_in_migrations.sh
|
||||||
ci/disallow_long_changelog_entries.sh
|
ci/disallow_long_changelog_entries.sh
|
||||||
ci/normalize_expected.sh
|
ci/normalize_expected.sh
|
||||||
|
ci/fix_gitignore.sh
|
||||||
|
|
Loading…
Reference in New Issue