Remove all references to .source files

pull/6138/head
Hanefi Onaldi 2022-08-06 02:57:47 +03:00
parent 9f52fa7610
commit a58523f1d8
No known key found for this signature in database
GPG Key ID: F18CDB10BA0DFDC7
7 changed files with 4 additions and 32 deletions

View File

@ -17,12 +17,6 @@ trim_trailing_whitespace = true
insert_final_newline = unset insert_final_newline = unset
trim_trailing_whitespace = unset trim_trailing_whitespace = unset
# Don't change test/regress/output directory, this needs to be a separate rule
# for some reason
[/src/test/regress/output/**]
insert_final_newline = unset
trim_trailing_whitespace = unset
[*.{sql,sh,py}] [*.{sql,sh,py}]
indent_style = space indent_style = space
indent_size = 4 indent_size = 4

1
.gitattributes vendored
View File

@ -16,7 +16,6 @@ README.* conflict-marker-size=32
# Test output files that contain extra whitespace # Test output files that contain extra whitespace
*.out -whitespace *.out -whitespace
src/test/regress/output/*.source -whitespace
# These files are maintained or generated elsewhere. We take them as is. # These files are maintained or generated elsewhere. We take them as is.
configure -whitespace configure -whitespace

View File

@ -363,11 +363,8 @@ This was deemed to be error prone and not worth the effort.
This script checks and fixes issues with `.gitignore` rules: This script checks and fixes issues with `.gitignore` rules:
1. Makes sure 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 to reflect this change.
2. Makes sure we do not commit any generated files that should be ignored. If there is an 1. Makes sure we do not commit any generated files that should be ignored. If there is an
ignored file in the git tree, the user is expected to review the files that are removed ignored file in the git tree, the user is expected to review the files that are removed
from the git tree and commit them. from the git tree and commit them.

View File

@ -7,13 +7,12 @@ source ci/ci_helpers.sh
cd src/test/regress cd src/test/regress
# 1. Find all *.sql *.spec and *.source files in the sql, spec and input # 1. Find all *.sql and *.spec files in the sql, and spec directories
# directories
# 2. Strip the extension and the directory # 2. Strip the extension and the directory
# 3. Ignore names that end with .include, those files are meant to be in an C # 3. Ignore names that end with .include, those files are meant to be in an C
# preprocessor #include statement. They should not be in schedules. # preprocessor #include statement. They should not be in schedules.
test_names=$( test_names=$(
find sql spec input -iname "*.sql" -o -iname "*.spec" -o -iname "*.source" | find sql spec -iname "*.sql" -o -iname "*.spec" |
sed -E 's#^\w+/([^/]+)\.[^.]+$#\1#g' | sed -E 's#^\w+/([^/]+)\.[^.]+$#\1#g' |
grep -v '.include$' grep -v '.include$'
) )

View File

@ -1,24 +1,8 @@
#! /bin/bash #! /bin/bash
# shellcheck disable=SC2012
set -euo pipefail set -euo pipefail
# shellcheck disable=SC1091 # shellcheck disable=SC1091
source ci/ci_helpers.sh 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
# Remove all the ignored files from git tree, and error out # Remove all the ignored files from git tree, and error out
# find all ignored files in git tree, and use quotation marks to prevent word splitting on filenames with spaces in them # find all ignored files in git tree, and use quotation marks to prevent word splitting on filenames with spaces in them
ignored_lines_in_git_tree=$(git ls-files --ignored --exclude-standard | sed 's/.*/"&"/') ignored_lines_in_git_tree=$(git ls-files --ignored --exclude-standard | sed 's/.*/"&"/')

View File

@ -16,7 +16,6 @@ README.* conflict-marker-size=32
# Test output files that contain extra whitespace # Test output files that contain extra whitespace
*.out -whitespace *.out -whitespace
src/test/regress/output/*.source -whitespace
# These files are maintained or generated elsewhere. We take them as is. # These files are maintained or generated elsewhere. We take them as is.
configure -whitespace configure -whitespace

View File

@ -263,7 +263,7 @@ clean-upgrade-artifacts:
rm -rf $(citus_abs_srcdir)/tmp_citus_tarballs/ $(citus_abs_srcdir)/tmp_citus_upgrade/ /tmp/citus_copy/ rm -rf $(citus_abs_srcdir)/tmp_citus_tarballs/ $(citus_abs_srcdir)/tmp_citus_upgrade/ /tmp/citus_copy/
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f $(output_files) $(input_files) rm -rf input/ output/
rm -rf tmp_check/ rm -rf tmp_check/
rm -rf tmp_citus_test/ rm -rf tmp_citus_test/