From ed7fb8ca6f1b04faa9635f9356e43501a8535353 Mon Sep 17 00:00:00 2001 From: dot-snack Date: Thu, 2 May 2024 15:17:07 -0700 Subject: [PATCH] Modernized "data/" directory structure, removed obsolete .conf and include.sh code, added "apps/ci" and pr template --- .git_commit_template.txt | 49 ------------------- README.md | 8 +-- apps/.gitkeep | 0 apps/ci/.gitkeep | 0 apps/ci/ci-codestyle.sh | 40 +++++++++++++++ conf/conf.sh.dist | 26 ---------- .../sql/db-characters/{ => base}/trasmorg.sql | 0 data/sql/db-characters/updates/.gitkeep | 0 .../db-world/{ => base}/trasm_world_NPC.sql | 0 .../db-world/{ => base}/trasm_world_texts.sql | 0 data/sql/db-world/updates/.gitkeep | 0 data/sql/updates/char/.dummy | 1 - data/sql/updates/world/.dummy | 1 - include.sh | 9 ---- pull_request_template.md | 25 ++++++++++ setup_git_commit_template.sh | 4 -- 16 files changed, 67 insertions(+), 96 deletions(-) delete mode 100644 .git_commit_template.txt create mode 100644 apps/.gitkeep create mode 100644 apps/ci/.gitkeep create mode 100644 apps/ci/ci-codestyle.sh delete mode 100644 conf/conf.sh.dist rename data/sql/db-characters/{ => base}/trasmorg.sql (100%) create mode 100644 data/sql/db-characters/updates/.gitkeep rename data/sql/db-world/{ => base}/trasm_world_NPC.sql (100%) rename data/sql/db-world/{ => base}/trasm_world_texts.sql (100%) create mode 100644 data/sql/db-world/updates/.gitkeep delete mode 100644 data/sql/updates/char/.dummy delete mode 100644 data/sql/updates/world/.dummy create mode 100644 pull_request_template.md delete mode 100755 setup_git_commit_template.sh diff --git a/.git_commit_template.txt b/.git_commit_template.txt deleted file mode 100644 index 708b5512d..000000000 --- a/.git_commit_template.txt +++ /dev/null @@ -1,49 +0,0 @@ -### TITLE -## Type(Scope/Subscope): Commit ultra short explanation -## |---- Write below the examples with a maximum of 50 characters ----| -## Example 1: fix(DB/SAI): Missing spell to NPC Hogger -## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros -## Example 3: feat(CORE/Commands): New GM command to do something - - -### DESCRIPTION -## Explain why this change is being made, what does it fix etc... -## |---- Write below the examples with a maximum of 72 characters per lines ----| -## Example: Hogger (id: 492) was not charging player when being engaged. - - -## Provide links to any issue, commit, pull request or other resource -## Example 1: Closes issue #23 -## Example 2: Ported from other project's commit (link) -## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/ - - - -## ======================================================= -## EXTRA INFOS -## ======================================================= -## "Type" can be: -## feat (new feature) -## fix (bug fix) -## refactor (refactoring production code) -## style (formatting, missing semi colons, etc; no code change) -## docs (changes to documentation) -## test (adding or refactoring tests; no production code change) -## chore (updating bash scripts, git files etc; no production code change) -## -------------------- -## Remember to -## Capitalize the subject line -## Use the imperative mood in the subject line -## Do not end the subject line with a period -## Separate subject from body with a blank line -## Use the body to explain what and why rather than how -## Can use multiple lines with "-" for bullet points in body -## -------------------- -## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/ -## ======================================================= -## "Scope" can be: -## CORE (core related, c++) -## DB (database related, sql) -## ======================================================= -## "Subscope" is optional and depends on the nature of the commit. -## ======================================================= diff --git a/README.md b/README.md index 59e5255aa..6eb08c325 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,9 @@ git clone https://github.com/azerothcore/mod-transmog.git or you can manually [download the module](https://github.com/azerothcore/mod-transmog/archive/master.zip), unzip the Transmog folder and place it under the `azerothcore/modules` directory. -### 2) Import the SQL to the right Database (auth, world or characters) +### 2) Re-run cmake and launch a clean build of AzerothCore -Import the SQL manually to the right Database (auth, world or characters) or with the `db_assembler.sh` (if `include.sh` provided). - -### 3) Re-run cmake and launch a clean build of AzerothCore - -### 4) Place transmog npc +### 3) Place transmog npc With a gm account goto the location you want to add the npc and use this command: diff --git a/apps/.gitkeep b/apps/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/apps/ci/.gitkeep b/apps/ci/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/apps/ci/ci-codestyle.sh b/apps/ci/ci-codestyle.sh new file mode 100644 index 000000000..c96a31df0 --- /dev/null +++ b/apps/ci/ci-codestyle.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e + +echo "Codestyle check script:" +echo + +declare -A singleLineRegexChecks=( + ["LOG_.+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above" + ["[[:blank:]]$"]="Remove whitespace at the end of the lines above" + ["\t"]="Replace tabs with 4 spaces in the lines above" +) + +for check in ${!singleLineRegexChecks[@]}; do + echo " Checking RegEx: '${check}'" + + if grep -P -r -I -n ${check} src; then + echo + echo "${singleLineRegexChecks[$check]}" + exit 1 + fi +done + +declare -A multiLineRegexChecks=( + ["LOG_[^;]+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above" + ["\n\n\n"]="Multiple blank lines detected, keep only one. Check the files above" +) + +for check in ${!multiLineRegexChecks[@]}; do + echo " Checking RegEx: '${check}'" + + if grep -Pzo -r -I ${check} src; then + echo + echo + echo "${multiLineRegexChecks[$check]}" + exit 1 + fi +done + +echo +echo "Everything looks good" diff --git a/conf/conf.sh.dist b/conf/conf.sh.dist deleted file mode 100644 index c19aa175c..000000000 --- a/conf/conf.sh.dist +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# -# CUSTOM -# - -DB_CHARACTERS_CUSTOM_PATHS+=( - $TRANSM_PATH_ROOT"/data/sql/db-characters/" -) - -DB_WORLD_CUSTOM_PATHS+=( - $TRANSM_PATH_ROOT"/data/sql/db-world/" -) - -# -# UPDATES -# - -DB_CHARACTERS_UPDATE_PATHS+=( - $TRANSM_PATH_ROOT"/data/sql/updates/char/" -) - -DB_WORLD_UPDATE_PATHS+=( - $TRANSM_PATH_ROOT"/data/sql/updates/world/" -) - diff --git a/data/sql/db-characters/trasmorg.sql b/data/sql/db-characters/base/trasmorg.sql similarity index 100% rename from data/sql/db-characters/trasmorg.sql rename to data/sql/db-characters/base/trasmorg.sql diff --git a/data/sql/db-characters/updates/.gitkeep b/data/sql/db-characters/updates/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/data/sql/db-world/trasm_world_NPC.sql b/data/sql/db-world/base/trasm_world_NPC.sql similarity index 100% rename from data/sql/db-world/trasm_world_NPC.sql rename to data/sql/db-world/base/trasm_world_NPC.sql diff --git a/data/sql/db-world/trasm_world_texts.sql b/data/sql/db-world/base/trasm_world_texts.sql similarity index 100% rename from data/sql/db-world/trasm_world_texts.sql rename to data/sql/db-world/base/trasm_world_texts.sql diff --git a/data/sql/db-world/updates/.gitkeep b/data/sql/db-world/updates/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/data/sql/updates/char/.dummy b/data/sql/updates/char/.dummy deleted file mode 100644 index 8b1378917..000000000 --- a/data/sql/updates/char/.dummy +++ /dev/null @@ -1 +0,0 @@ - diff --git a/data/sql/updates/world/.dummy b/data/sql/updates/world/.dummy deleted file mode 100644 index 8b1378917..000000000 --- a/data/sql/updates/world/.dummy +++ /dev/null @@ -1 +0,0 @@ - diff --git a/include.sh b/include.sh index 159bc4479..e69de29bb 100644 --- a/include.sh +++ b/include.sh @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -TRANSM_PATH_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )" - -source $TRANSM_PATH_ROOT"/conf/conf.sh.dist" - -if [ -f $TRANSM_PATH_ROOT"/conf/conf.sh" ]; then - source $TRANSM_PATH_ROOT"/conf/conf.sh" -fi diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 000000000..21c924582 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,25 @@ + + +## Changes Proposed: +- +- + +## Issues Addressed: + +- Closes + +## SOURCE: + + +## Tests Performed: + +- +- + + +## How to Test the Changes: + + +1. +2. +3. diff --git a/setup_git_commit_template.sh b/setup_git_commit_template.sh deleted file mode 100755 index 7b52062d1..000000000 --- a/setup_git_commit_template.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -## Set a local git commit template -git config --local commit.template ".git_commit_template.txt" ;