aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJuan Ramos <juan@lunarg.com>2023-10-05 12:57:25 -0600
committerJuan Ramos <114601453+juan-lunarg@users.noreply.github.com>2023-10-05 14:18:09 -0600
commit0bd59f5c160a742d64b23df1244e41b43778c6b1 (patch)
tree3b7eb2b72a564adaabe32f66bd11a803ec1aa080 /scripts
parentf49a190541473611a88a6a621c66471025bf7569 (diff)
downloadusermoji-0bd59f5c160a742d64b23df1244e41b43778c6b1.tar.xz
Remove unused scripts
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check_code_format.sh45
-rwxr-xr-xscripts/check_commit_message_format.sh102
-rwxr-xr-xscripts/determine_vs_version.py119
3 files changed, 0 insertions, 266 deletions
diff --git a/scripts/check_code_format.sh b/scripts/check_code_format.sh
deleted file mode 100755
index dbd7b799..00000000
--- a/scripts/check_code_format.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2017 Google Inc.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Script to determine if source code in Pull Request is properly formatted.
-# Exits with non 0 exit code if formatting is needed.
-#
-# This script assumes to be invoked at the project root directory.
-
-RED='\033[0;31m'
-GREEN='\033[0;32m'
-NC='\033[0m' # No Color
-
-clang-format --version
-
-FILES_TO_CHECK=$(git diff --name-only main | grep -v -E "^include/vulkan" | grep -E ".*\.(cpp|cc|c\+\+|cxx|c|h|hpp)$")
-
-if [ -z "${FILES_TO_CHECK}" ]; then
- echo -e "${GREEN}No source code to check for formatting.${NC}"
- exit 0
-fi
-
-FORMAT_DIFF=$(git diff -U0 main -- ${FILES_TO_CHECK} | python ./scripts/clang-format-diff.py -p1 -style=file)
-
-if [ -z "${FORMAT_DIFF}" ]; then
- echo -e "${GREEN}All source code in PR properly formatted.${NC}"
- exit 0
-else
- echo -e "${RED}Found formatting errors!${NC}"
- echo "${FORMAT_DIFF}"
- echo "Be sure you are using the following version of clang-format:"
- clang-format --version
- exit 1
-fi
diff --git a/scripts/check_commit_message_format.sh b/scripts/check_commit_message_format.sh
deleted file mode 100755
index 29666356..00000000
--- a/scripts/check_commit_message_format.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2018 Valve Corporation
-# Copyright (c) 2018 LunarG, Inc.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Checks commit messages against project standards in CONTRIBUTING.md document
-# Script to determine if commit messages in Pull Request are properly formatted.
-# Exits with non 0 exit code if reformatting is needed.
-
-# Disable subshells
-shopt -s lastpipe
-
-RED='\033[0;31m'
-GREEN='\033[0;32m'
-NC='\033[0m' # No Color
-
-# TRAVIS_COMMIT_RANGE contains range of commits for this PR
-
-# Get user-supplied commit message text for applicable commits and insert
-# a unique separator string identifier. The git command returns ONLY the
-# subject line and body for each of the commits.
-COMMIT_TEXT=$(git log ${TRAVIS_COMMIT_RANGE} --pretty=format:"XXXNEWLINEXXX"%n%B)
-
-# Bail if there are none
-if [ -z "${COMMIT_TEXT}" ]; then
- echo -e "${GREEN}No commit messgages to check for formatting.${NC}"
- exit 0
-elif ! echo $TRAVIS_COMMIT_RANGE | grep -q "\.\.\."; then
- echo -e "${GREEN}No commit messgages to check for formatting.${NC}"
- exit 0
-fi
-
-# Process commit messages
-success=1
-current_line=0
-prevline=""
-
-# Process each line of the commit message output, resetting counter on separator
-printf %s "$COMMIT_TEXT" | while IFS='' read -r line; do
- # echo "Count = $current_line <Line> = $line"
- current_line=$((current_line+1))
- if [ "$line" = "XXXNEWLINEXXX" ]; then
- current_line=0
- fi
- chars=${#line}
- if [ $current_line -eq 1 ]; then
- # Subject line should be 50 chars or less (but give some slack here)
- if [ $chars -gt 54 ]; then
- echo "The following subject line exceeds 50 characters in length."
- echo " '$line'"
- success=0
- fi
- i=$(($chars-1))
- last_char=${line:$i:1}
- # Output error if last char of subject line is not alpha-numeric
- if [[ ! $last_char =~ [0-9a-zA-Z] ]]; then
- echo "For the following commit, the last character of the subject line must not be non-alphanumeric."
- echo " '$line'"
- success=0
- fi
- # Checking if subject line doesn't start with 'module: '
- prefix=$(echo $line | cut -f1 -d " ")
- if [ "${prefix: -1}" != ":" ]; then
- echo "The following subject line must start with a single word specifying the functional area of the change, followed by a colon and space. I.e., 'layers: Subject line here'"
- echo " '$line'"
- success=0
- fi
- elif [ $current_line -eq 2 ]; then
- # Commit message must have a blank line between subject and body
- if [ $chars -ne 0 ]; then
- echo "The following subject line must be followed by a blank line."
- echo " '$prevline'"
- success=0
- fi
- else
- # Lines in a commit message body must be less than 72 characters in length (but give some slack)
- if [ $chars -gt 76 ]; then
- echo "The following commit message body line exceeds the 72 character limit."
- echo "'$line\'"
- success=0
- fi
- fi
- prevline=$line
-done
-
-if [ $success -eq 1 ]; then
- echo -e "${GREEN}All commit messages in pull request are properly formatted.${NC}"
- exit 0
-else
- exit 1
-fi
diff --git a/scripts/determine_vs_version.py b/scripts/determine_vs_version.py
deleted file mode 100755
index 7982bf71..00000000
--- a/scripts/determine_vs_version.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (c) 2016 The Khronos Group Inc.
-# Copyright (c) 2016 Valve Corporation
-# Copyright (c) 2016 LunarG, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Author: Mark Young <marky@lunarg.com>
-
-import sys
-import os
-import subprocess
-
-# Following function code snippet was found on StackOverflow (with a change to lower
-# camel-case on the variable names):
-# http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python
-def find_executable(program):
- def is_exe(fPath):
- return os.path.isfile(fPath) and os.access(fPath, os.X_OK)
-
- fPath, fName = os.path.split(program)
- if fPath:
- if is_exe(program):
- return program
- else:
- for path in os.environ["PATH"].split(os.pathsep):
- path = path.strip('"')
- exe_file = os.path.join(path, program)
- if is_exe(exe_file):
- return exe_file
-
- return None
-
-def determine_year(version):
- if version == 8:
- return 2005
- elif version == 9:
- return 2008
- elif version == 10:
- return 2010
- elif version == 11:
- return 2012
- elif version == 12:
- return 2013
- elif version == 14:
- return 2015
- elif version == 15:
- return 2017
- else:
- return 0000
-
-# Determine if msbuild is in the path, then call it to determine the version and parse
-# it into a format we can use, which is "<version_num> <version_year>".
-if __name__ == '__main__':
- exeName = 'msbuild.exe'
- arguments = '/ver'
-
- # Determine if the executable exists in the path, this is critical.
- #
- foundExeName = find_executable(exeName)
-
- # If not found, return an invalid number but in the appropriate format so it will
- # fail if the program above tries to use it.
- if foundExeName == None:
- print('00 0000')
- print('Executable ' + exeName + ' not found in PATH!')
- else:
- proc = subprocess.Popen([exeName, arguments], stdout=subprocess.PIPE)
- sysCallOut = proc.stdout.readline().decode('iso-8859-1').rstrip()
-
- version = None
-
- # Split around any spaces first
- spaceList = sysCallOut.split(' ')
- for spaceString in spaceList:
-
- # If we've already found it, bail.
- if version != None:
- break
-
- # Now split around line feeds
- lineList = spaceString.split('\n')
- for curLine in lineList:
-
- # If we've already found it, bail.
- if version != None:
- break
-
- # We only want to continue if there's a period in the list
- if '.' not in curLine:
- continue
-
- # Get the first element and determine if it is a number, if so, we've
- # got our number.
- splitAroundPeriod = curLine.split('.')
- if splitAroundPeriod[0].isdigit():
- version = int (splitAroundPeriod[0])
- break
-
- # Failsafe to return a number in the proper format, but one that will fail.
- if version == None:
- version = 00
-
- # Determine the year associated with that version
- year = determine_year(version)
-
- # Output the string we need for Cmake to properly build for this version
- print(str(version) + ' ' + str(year))