Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #13

Merged
merged 188 commits into from
Jul 4, 2022
Merged

Dev #13

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
d3827fe
Merge pull request #2 from brainboxdotcc/dev
Commandserver May 22, 2022
1f3f820
added three attributes (tags, install_params and custom_install_url) …
Commandserver May 22, 2022
0667cf8
deprecated guild_bulk_command_edit_permissions
Commandserver May 22, 2022
9f1dc6b
.
Commandserver May 22, 2022
e209d9f
Merge pull request #390 from Commandserver/dev
braindigitalis May 22, 2022
13aa6f0
Depend discord_voice_client::voice_payload priority only on timestamps.
kar8uncle May 23, 2022
bdb8689
Merge pull request #391 from kar8uncle/patch-1
braindigitalis May 23, 2022
cb04fbe
updated docs
Commandserver May 24, 2022
d590677
update title for better SEO
braindigitalis May 24, 2022
9cbb2dd
adjust main page title
braindigitalis May 24, 2022
6e1abd9
Merge pull request #392 from Commandserver/dev
braindigitalis May 24, 2022
4bac9d9
removed deprecated exclamation mark from guild_member::get_mention
Commandserver May 25, 2022
52c5cfb
Merge pull request #393 from Commandserver/dev
braindigitalis May 25, 2022
1f595c3
small doc improvements of slashcommand.h and some intent fixes
Commandserver May 25, 2022
eb45706
implemented channel::get_icon_url
Commandserver May 25, 2022
39f6d15
Merge pull request #394 from Commandserver/dev
braindigitalis May 25, 2022
b4c2b0d
renamed role_permissions to permissions
Commandserver May 26, 2022
abc3c42
updated doc of application_install_params
Commandserver May 26, 2022
430ab96
moved the permissions from role.h to the new permissions.h & added pe…
Commandserver May 26, 2022
1905d04
updated permission class
Commandserver May 26, 2022
58cef62
updated docs of the permission class
Commandserver May 26, 2022
67d0dbc
updated permission class
Commandserver May 26, 2022
71d9224
make return type permission methods for chaining
Commandserver May 26, 2022
e8d703c
big rework: replace uint64_t on various places with dpp::permission
Commandserver May 26, 2022
9914ed7
make permission::value protected
Commandserver May 26, 2022
fe92dbf
Merge branch 'dev' into dev
braindigitalis May 26, 2022
ba84c59
added unit test for dpp::permission
Commandserver May 26, 2022
be649d8
updated docs on channel_edit_permissions
Commandserver May 26, 2022
79ca2c9
updated dpp::permission::has
Commandserver May 26, 2022
045afb5
fixed dpp::permission unit test
Commandserver May 26, 2022
4689873
Merge pull request #395 from Commandserver/dev
braindigitalis May 26, 2022
0f7afcb
ci: refactor unit tests to allow for offline tests and online tests. …
braindigitalis May 27, 2022
51cbbfe
removed example from slashcommand::set_default_permissions as you can…
Commandserver May 27, 2022
0398f35
Merge pull request #4 from brainboxdotcc/dev
Commandserver May 27, 2022
5038b06
Merge remote-tracking branch 'origin/dev' into dev
Commandserver May 27, 2022
f0e1265
added guild_member_remove_role and deprecated guild_member_delete_rol…
Commandserver May 27, 2022
dc35e59
updated sync call methods
Commandserver May 27, 2022
4ac4910
impro: support multiple parameters to permission::add(), remove(), set()
braindigitalis May 27, 2022
c4cd11d
ci: unit test 'TS' is an online test
braindigitalis May 27, 2022
f18bf94
Merge branch 'dev' into dev
braindigitalis May 27, 2022
f6d2cd5
Merge pull request #396 from Commandserver/dev
braindigitalis May 27, 2022
2b9cb55
Merge pull request #5 from brainboxdotcc/dev
Commandserver May 27, 2022
539357e
added examples in the method docs of dpp::permission
Commandserver May 27, 2022
f2fd650
Merge pull request #397 from Commandserver/dev
braindigitalis May 27, 2022
f7748e5
make permissions not look like dog shit
es183923 May 27, 2022
ae81299
add back returning *this
es183923 May 27, 2022
45834e0
fix/docs: doxygen
braindigitalis May 27, 2022
1bd5801
fix: add export
braindigitalis May 27, 2022
c32852e
Merge pull request #398 from es183923/dev
braindigitalis May 27, 2022
6cf7c03
Merge pull request #6 from brainboxdotcc/dev
Commandserver May 27, 2022
b00b1cd
added missing include in permissions.h
Commandserver May 28, 2022
7841ab5
change to using ctest to run tests, as this is more standardized
braindigitalis May 28, 2022
f668722
add ctest to cspell
braindigitalis May 28, 2022
30b32e0
add template to only enable for int convertible types
es183923 May 28, 2022
bda138c
Merge branch 'brainboxdotcc:dev' into dev
es183923 May 28, 2022
57f3107
Fill member data from the whole json object
May 28, 2022
c4a34ff
use folding instead of conjunction
es183923 May 28, 2022
cd58cbe
Merge pull request #402 from es183923/dev
braindigitalis May 28, 2022
3f85fe3
Merge pull request #7 from brainboxdotcc/dev
Commandserver May 28, 2022
2429dc1
make permission::has takes multiple params
Commandserver May 28, 2022
eef81ae
Merge pull request #403 from Linker-123/dev
braindigitalis May 28, 2022
7339bfc
Fix discord_voice_client voice_payload priority when two payloads hav…
kar8uncle May 29, 2022
34c8509
Merge pull request #405 from kar8uncle/master
braindigitalis May 29, 2022
d2d5e92
Merge pull request #404 from Commandserver/dev
braindigitalis May 29, 2022
377c474
Merge pull request #8 from brainboxdotcc/dev
Commandserver May 29, 2022
42f19ab
breaking change: updated webhook methods in cluster
Commandserver May 29, 2022
3fed629
updated doc of cluster::get_webhook_message
Commandserver May 29, 2022
4d6e030
make sync methods
Commandserver May 29, 2022
9923455
fix double API_PATH and weirdness of operators
braindigitalis May 29, 2022
ed0c614
fix: wrap-around for voice receive
braindigitalis May 29, 2022
c43413e
small regex hotfix in make_sync_struct.php
Commandserver May 29, 2022
b3f6703
updated sync methods
Commandserver May 29, 2022
fd6663d
Merge remote-tracking branch 'origin/dev' into dev
Commandserver May 29, 2022
c4c6cb6
Merge remote-tracking branch 'origin/dev' into dev
Commandserver May 29, 2022
904f689
Merge pull request #406 from Commandserver/dev
braindigitalis May 29, 2022
7f6ade1
style: improve comments and PSR-12 style in this file
braindigitalis May 29, 2022
95ca8b8
style: PSR-12
braindigitalis May 29, 2022
eab369f
style: PSR-12
braindigitalis May 29, 2022
2f00aec
[misc] some common git ignores
raxyte May 30, 2022
fffb744
[fix] don't document deps
raxyte May 30, 2022
a83c754
[fix] docs typo
raxyte May 30, 2022
6de1a28
Merge pull request #407 from Axyte/master
braindigitalis May 30, 2022
40a6f26
[docs] ignore src directory
raxyte May 30, 2022
d8feb55
[minor] add new channel flags
raxyte May 30, 2022
edbf84c
Merge pull request #408 from Axyte/master
braindigitalis May 30, 2022
1310187
refactor: move a bunch of socket headers inside the cpp files that us…
braindigitalis May 30, 2022
23f32b9
fix: win32 builds with moved headers
braindigitalis May 30, 2022
924935b
fix duplicate includes
braindigitalis May 31, 2022
9456425
Merge pull request #10 from brainboxdotcc/dev
Commandserver Jun 1, 2022
cb1b999
version bump
braindigitalis Jun 2, 2022
0e93f00
[fix] UB (__next_handle)
raxyte Jun 2, 2022
82934be
Merge pull request #410 from Axyte/master
braindigitalis Jun 2, 2022
4c3fa96
Added a voice client option to skip throttling for live audio data.
kar8uncle Jun 6, 2022
6618f1b
Merge pull request #411 from kar8uncle/master
braindigitalis Jun 6, 2022
eef34d9
Remove audit log reference under Modify Guild Channel Positions
Commandserver Jun 8, 2022
93884d2
breaking: added thread_name parameter to dpp::cluster::execute_webhook
Commandserver Jun 8, 2022
3e6b09d
added note to execute_webhook
Commandserver Jun 8, 2022
628ac12
forget to make the sync methods
Commandserver Jun 8, 2022
4ce4700
make thread_name param of execute_webhook const ref
Commandserver Jun 8, 2022
c82ea23
make execute_webhook nicer
Commandserver Jun 9, 2022
8e07aa2
make execute_webhook nicer
Commandserver Jun 9, 2022
8b60c25
Merge pull request #412 from Commandserver/dev
braindigitalis Jun 9, 2022
77a2e6d
deprecated cluster::guild_ban_add with reason param. Added a similar …
Commandserver Jun 9, 2022
005b42e
fix cluster::guild_begin_prune
Commandserver Jun 9, 2022
c7bec36
breaking: removed reason parameter from cluster::guild_ban_add method
Commandserver Jun 9, 2022
fccb729
Merge pull request #413 from Commandserver/dev
braindigitalis Jun 11, 2022
99d6ce9
ci: add gitguardian
braindigitalis Jun 13, 2022
e436ebc
Merge pull request #414 from brainboxdotcc/master
braindigitalis Jun 13, 2022
5fef1a1
📝 Add AUR shield
Eremiell Jun 14, 2022
b48cc7f
📝 Add link to the AUR shield
Eremiell Jun 14, 2022
102c3e0
Merge pull request #415 from Eremiell/aur-shield
braindigitalis Jun 14, 2022
555734a
fix: dont run gg on pr
braindigitalis Jun 14, 2022
006f152
updated how the url parameters are created in guild_member.cpp
Commandserver Jun 15, 2022
7e61fdc
updated docs of some events
Commandserver Jun 15, 2022
aa5fb6c
Merge pull request #416 from Commandserver/dev
braindigitalis Jun 15, 2022
763534b
Added voice action bitflag for guild_member fixed #417
unsigned-ru Jun 17, 2022
c5de7f4
Merge pull request #419 from unsigned-ru/master
braindigitalis Jun 17, 2022
446478d
update to new identify fields without $ prefix
braindigitalis Jun 17, 2022
99a5b18
Merge branch 'dev' of github.com:brainboxdotcc/DPP into dev
braindigitalis Jun 17, 2022
e7972d0
add os detection
es183923 Jun 18, 2022
266a49d
include limits to fix buids
es183923 Jun 18, 2022
375754e
add parens
es183923 Jun 18, 2022
b370557
Merge pull request #11 from brainboxdotcc/dev
Commandserver Jun 18, 2022
6e1f356
remove other stuff
es183923 Jun 18, 2022
c6d9564
remove NOMINMAX definition
es183923 Jun 18, 2022
4328515
make stringify work when its unknown
es183923 Jun 18, 2022
fc82060
deprecated message::set_file_content and message::set_filename
Commandserver Jun 18, 2022
58f0fac
Merge pull request #423 from Commandserver/dev
braindigitalis Jun 18, 2022
5d454d2
Merge pull request #421 from es183923/dev
braindigitalis Jun 19, 2022
a2c45ac
edit the `has_create_instant_invite()` definition
harshfeudal Jun 19, 2022
8dd047d
Merge pull request #424 from harshfeudal/dev
braindigitalis Jun 19, 2022
4d2c855
updated some docs in cluster
Commandserver Jun 19, 2022
30a2084
update
Commandserver Jun 19, 2022
c26bf97
breaking: updated params of guild::permission_overwrites and guild::b…
Commandserver Jun 19, 2022
e324b0c
make the params pointers
Commandserver Jun 19, 2022
064e288
updated channel permission getter
Commandserver Jun 19, 2022
a7fc514
check for nullptr
Commandserver Jun 19, 2022
61e0d45
update
Commandserver Jun 20, 2022
c52f069
update
Commandserver Jun 20, 2022
b16244b
Support webhook avatar for execute_webhook
yuto0214w Jun 21, 2022
b4ace20
start of automod stuff
braindigitalis Jun 21, 2022
1b16849
start of automod stuff
braindigitalis Jun 21, 2022
4bf5e7a
compile errors
braindigitalis Jun 21, 2022
974b1b1
feat: serialisation functions for automod structs
braindigitalis Jun 21, 2022
b652a32
fixed nullptr bug in guild::base_permissions & refactor
Commandserver Jun 21, 2022
2cf278f
feat: auto moderation events
braindigitalis Jun 21, 2022
2b56a02
update
Commandserver Jun 21, 2022
8c45bec
fixed guild::permission_overwrites didn't compute the correct permiss…
Commandserver Jun 21, 2022
08601dd
feat: automod_rule_execute
braindigitalis Jun 21, 2022
6decf30
feat: automod REST endpoints: cluster::automod_rules_get(), cluster::…
braindigitalis Jun 22, 2022
49a1cea
fix: add to cspell
braindigitalis Jun 22, 2022
309f707
docs: comments to document automod
braindigitalis Jun 22, 2022
facf668
Merge pull request #429 from brainboxdotcc/automod
braindigitalis Jun 22, 2022
d75339c
Merge branch 'dev' into dev
yuto0214w Jun 22, 2022
b0e0293
update
Commandserver Jun 22, 2022
e12f92e
Merge pull request #426 from Commandserver/dev
braindigitalis Jun 23, 2022
e9c4ed7
Merge pull request #428 from yuto0214w/dev
braindigitalis Jun 23, 2022
78f905f
version bump
braindigitalis Jun 24, 2022
45c509f
Merge pull request #430 from brainboxdotcc/automod
braindigitalis Jun 24, 2022
4140dbb
timeouts on REST threads are way too low
braindigitalis Jun 25, 2022
6fdea16
fix: improve reliability of connections, handle ssl_connect dying and…
braindigitalis Jun 28, 2022
4f3665d
fix: don't throw new, we can't catch it
braindigitalis Jun 29, 2022
4554999
fix: windows breakage
braindigitalis Jun 29, 2022
9d480ad
refactor: dns lookup improvements
braindigitalis Jun 29, 2022
c626604
Merge branch 'dev' of github.com:brainboxdotcc/DPP into dev
braindigitalis Jun 29, 2022
58d3987
refactor: dns lookup and timeout tidyups
braindigitalis Jun 29, 2022
094f9a0
refactor: move dns resolution to its own files
braindigitalis Jun 29, 2022
3eadb92
feature: add dns caching
braindigitalis Jun 29, 2022
c5e5520
fix: this should not be exported to the windows dll
braindigitalis Jun 29, 2022
a2c1231
fix docs for dns cache
braindigitalis Jun 29, 2022
372fb2f
docs: can directly embed dot graphs into doxygen, with pan and zoom f…
braindigitalis Jun 29, 2022
345e240
fix: allow slash commands in dm, fixes #418
braindigitalis Jun 29, 2022
c858cb8
fix: max value for command option was broken
braindigitalis Jun 29, 2022
4eacb0c
feat: add interaction::app_permissions - https://github.com/discord/d…
braindigitalis Jun 29, 2022
847e188
version bump
braindigitalis Jun 30, 2022
f88120d
🐛 Fix DNS mutex include
Eremiell Jun 30, 2022
4eeb891
Merge pull request #435 from Eremiell/fix_dns_mutex
braindigitalis Jun 30, 2022
6efeb7b
bump ci g++-9 to g++-11
braindigitalis Jun 30, 2022
73d0909
ci: ensure GCC 9 and 10 are also covered
braindigitalis Jun 30, 2022
1aec89f
fix: windows sucks
braindigitalis Jul 1, 2022
48c933a
refactor: neater change
braindigitalis Jul 1, 2022
fe01341
Fix delete_webhook_with_token
yuto0214w Jul 1, 2022
8857031
Merge pull request #436 from yuto0214w/dev
braindigitalis Jul 1, 2022
d173458
Merge pull request #12 from brainboxdotcc/dev
Commandserver Jul 2, 2022
3a60e3e
typos
Commandserver Jul 2, 2022
f3b9ef8
typos v2
Commandserver Jul 2, 2022
80f4967
typos v3
Commandserver Jul 2, 2022
e904116
Merge pull request #437 from Commandserver/dev
braindigitalis Jul 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@
"clion",
"followup",
"gifv",
"ctls"
"ctls",
"ctest",
"automod",
"amod"
],
"flagWords": [
"hte"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: cd build && ninja

- name: Run unit tests
run: cd build && ./test
run: cd build && ctest -VV
env:
DPP_UNIT_TEST_TOKEN: ${{secrets.DPP_UNIT_TEST_TOKEN}}
TEST_GUILD_ID: ${{secrets.TEST_GUILD_ID}}
Expand Down Expand Up @@ -82,6 +82,8 @@ jobs:
fail-fast: false # Don't fail everything if one fails. We want to test each OS/Compiler individually
matrix:
cfg:
- { arch: 'amd64', os: ubuntu-latest, cpp-version: g++-11 }
- { arch: 'amd64', os: ubuntu-latest, cpp-version: g++-10 }
- { arch: 'amd64', os: ubuntu-20.04, cpp-version: g++-9 }

steps:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/gitguardian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: GitGuardian scan

on: [push]

jobs:
scanning:
name: GitGuardian scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history so multiple commits can be scanned
- name: GitGuardian scan
uses: GitGuardian/ggshield-action@master
env:
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ src/build
*.autosave
.misspell-fixer.ignore
core
compile_commands.json
tags
.cache
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"random": "cpp",
"variant": "cpp",
"unordered_set": "cpp",
"codecvt": "cpp"
"codecvt": "cpp",
"future": "cpp"
}
}
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ project(libdpp VERSION ${DPP_VERSION} LANGUAGES CXX)
check_cxx_symbol_exists(prctl "sys/prctl.h" HAVE_PRCTL)
check_cxx_symbol_exists(pthread_setname_np "pthread.h" HAVE_PTHREAD_SETNAME_NP)

add_compile_definitions(DPP_OS=${CMAKE_SYSTEM_NAME})

if(WIN32 AND NOT MINGW)
if (NOT WINDOWS_32_BIT)
message("-- Building for windows with precompiled packaged dependencies")
Expand Down Expand Up @@ -286,9 +288,16 @@ target_compile_features(dpp PRIVATE cxx_variadic_templates)
target_compile_features(dpp PRIVATE cxx_attribute_deprecated)

if (DPP_BUILD_TEST)
add_executable(test ${coresrc})
target_compile_features(test PRIVATE cxx_std_17)
target_link_libraries(test PUBLIC ${modname})
enable_testing(${PROJECT_SOURCE_DIR})
add_executable(unittest ${coresrc})
target_compile_features(unittest PRIVATE cxx_std_17)
target_link_libraries(unittest PUBLIC ${modname})
add_test(
NAME unittests
COMMAND unittest
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
)

endif()

if(HAVE_PRCTL)
Expand Down
18 changes: 4 additions & 14 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = "A Lightweight C++ library for Discord"
PROJECT_BRIEF = "C++ Discord API Bot Library"

# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
Expand Down Expand Up @@ -751,7 +751,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.

INPUT = docpages src include
INPUT = docpages include

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -805,18 +805,8 @@ EXCLUDE_SYMLINKS = YES
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*

EXCLUDE_PATTERNS = */json_fwd.hpp \
*/json.hpp \
*/format.cpp \
*/format.h \
*/printf.h \
*/os.h \
*/os.cpp \
*/color.h \
*/compile.h \
*/ostream.h \
*/ranges.h \
*/format-inl.h
EXCLUDE_PATTERNS = */dpp/nlohmann/* \
*/dpp/fmt/*

# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/39b054c38bba411d9b25b39524016c9e)](https://www.codacy.com/gh/brainboxdotcc/DPP/dashboard?utm_source=github.com&utm_medium=referral&utm_content=brainboxdotcc/DPP&utm_campaign=Badge_Grade)
![Lines of code](https://img.shields.io/tokei/lines/github/brainboxdotcc/DPP)
[![D++ CI](https://github.com/brainboxdotcc/DPP/actions/workflows/ci.yml/badge.svg)](https://github.com/brainboxdotcc/DPP/actions/workflows/ci.yml)
[![AUR version](https://img.shields.io/aur/version/dpp)](https://aur.archlinux.org/packages/dpp)

D++ is a lightweight and efficient library for Discord written in modern C++. It is designed to cover as much of the API specification as possible and to have a incredibly small memory footprint, even when caching large amounts of data.

Expand Down
171 changes: 85 additions & 86 deletions buildtools/changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,119 +4,118 @@

// Pattern list
$categories = [
'break' => '💣 Breaking Changes',
'breaking' => '💣 Breaking Changes',
'feat' => '✨ New Features',
'feature' => '✨ New Features',
'add' => '✨ New Features',
'added' => '✨ New Features',
'fix' => '🐞 Bug Fixes',
'bug' => '🐞 Bug Fixes',
'bugfix' => '🐞 Bug Fixes',
'fixed' => '🐞 Bug Fixes',
'fixes' => '🐞 Bug Fixes',
'perf' => '🚀 Performance Improvements',
'performance' => '🚀 Performance Improvements',
'impro' => '♻️ Refactoring',
'improved' => '♻️ Refactoring',
'improvement' => '♻️ Refactoring',
'refactor' => '♻️ Refactoring',
'refactored' => '♻️ Refactoring',
'deprecated' => '♻️ Refactoring',
'deprecate' => '♻️ Refactoring',
'remove' => '♻️ Refactoring',
'change' => '♻️ Refactoring',
'changed' => '♻️ Refactoring',
'test' => '🚨 Testing',
'testing' => '🚨 Testing',
'ci' => '👷 Build/CI',
'build' => '👷 Build/CI',
'docs' => '📚 Documentation',
'documentation' => '📚 Documentation',
'style' => '💎 Style Changes',
'chore' => '🔧 Chore',
'misc' => '📜 Miscellaneous Changes',
'update' => '📜 Miscellaneous Changes',
'updated' => '📜 Miscellaneous Changes',
'break' => '💣 Breaking Changes',
'breaking' => '💣 Breaking Changes',
'feat' => '✨ New Features',
'feature' => '✨ New Features',
'add' => '✨ New Features',
'added' => '✨ New Features',
'fix' => '🐞 Bug Fixes',
'bug' => '🐞 Bug Fixes',
'bugfix' => '🐞 Bug Fixes',
'fixed' => '🐞 Bug Fixes',
'fixes' => '🐞 Bug Fixes',
'perf' => '🚀 Performance Improvements',
'performance' => '🚀 Performance Improvements',
'impro' => '♻️ Refactoring',
'improved' => '♻️ Refactoring',
'improvement' => '♻️ Refactoring',
'refactor' => '♻️ Refactoring',
'refactored' => '♻️ Refactoring',
'deprecated' => '♻️ Refactoring',
'deprecate' => '♻️ Refactoring',
'remove' => '♻️ Refactoring',
'change' => '♻️ Refactoring',
'changed' => '♻️ Refactoring',
'test' => '🚨 Testing',
'testing' => '🚨 Testing',
'ci' => '👷 Build/CI',
'build' => '👷 Build/CI',
'docs' => '📚 Documentation',
'documentation' => '📚 Documentation',
'style' => '💎 Style Changes',
'chore' => '🔧 Chore',
'misc' => '📜 Miscellaneous Changes',
'update' => '📜 Miscellaneous Changes',
'updated' => '📜 Miscellaneous Changes',
];

$catgroup = [];
$changelog = [];
$githubstyle = true;
if (count($argv) > 2 && $argv[1] == '--discord') {
$githubstyle = false;
$githubstyle = false;
}

// Magic sauce
exec("git log --format=\"%s\" $(git log --no-walk --tags | head -n1 | cut -d ' ' -f 2)..HEAD | grep -v '^Merge '", $changelog);

// Leadin
if ($githubstyle) {
echo "The changelog is listed below:\n\nRelease Changelog\n===========\n";
echo "The changelog is listed below:\n\nRelease Changelog\n===========\n";
} else {
echo "The changelog is listed below:\n\n__**Release Changelog**__\n";
echo "The changelog is listed below:\n\n__**Release Changelog**__\n";
}

// Case insensitive removal of duplicates
$changelog = array_intersect_key($changelog, array_unique(array_map("strtolower", $changelog)));

foreach ($changelog as $change) {
// Wrap anything that looks like a symbol name in backticks
$change = preg_replace('/([\w_\/]+\.\w+|\S+\(\)|\w+::\w+|dpp::\w+|utility::\w+|(\w+_\w+)+)/', '`$1`', $change);
$change = preg_replace("/vs(\d+)/", "Visual Studio $1", $change);
$change = preg_replace("/\bfaq\b/", "FAQ", $change);
$change = preg_replace("/\bdiscord\b/", "Discord", $change);
$change = preg_replace("/\bmicrosoft\b/", "Microsoft", $change);
$change = preg_replace("/\bwindows\b/", "Windows", $change);
$change = preg_replace("/\blinux\b/", "Linux", $change);
$change = preg_replace("/\sarm(\d+)\s/i", ' ARM$1 ', $change);
$change = preg_replace("/\b(was|is|wo)nt\b/i", '$1n\'t', $change);
$change = preg_replace("/\bfreebsd\b/", 'FreeBSD', $change);
// Match keywords against categories
$matched = false;
foreach ($categories as $cat => $header) {
// Purposefully ignored
if (preg_match("/^Merge (branch|pull request|remote-tracking branch) /", $change) or preg_match("/version bump/i", $change)) {
$matched = true;
continue;
}
// Groupings
if ((preg_match("/^" . $cat . ":/i", $change)) or (preg_match("/^\[" . $cat . "\//i", $change)) or (preg_match("/^\[" . $cat . "\]/i", $change))or (preg_match("/^\[" . $cat . ":/i", $change)) or (preg_match("/^" . $cat . "\//i", $change)) or (preg_match("/^" . $cat . ":/i", $change))) {
if (!isset($catgroup[$header])) {
$catgroup[$header] = [];
}
$matched = true;
$catgroup[$header][] = preg_replace("/^\S+\s+/", "", $change);
break;
} else if (preg_match("/^" . $cat . " /i", $change)) {
if (!isset($catgroup[$header])) {
$catgroup[$header] = [];
}
$matched = true;
$catgroup[$header][] = $change;
break;
}
}

// Wrap anything that looks like a symbol name in backticks
$change = preg_replace('/([\w_\/]+\.\w+|\S+\(\)|\w+::\w+|dpp::\w+|utility::\w+|(\w+_\w+)+)/', '`$1`', $change);
$change = preg_replace("/vs(\d+)/", "Visual Studio $1", $change);
$change = preg_replace("/\bfaq\b/", "FAQ", $change);
$change = preg_replace("/\bdiscord\b/", "Discord", $change);
$change = preg_replace("/\bmicrosoft\b/", "Microsoft", $change);
$change = preg_replace("/\bwindows\b/", "Windows", $change);
$change = preg_replace("/\blinux\b/", "Linux", $change);
$change = preg_replace("/\sarm(\d+)\s/i", ' ARM$1 ', $change);
$change = preg_replace("/\b(was|is|wo)nt\b/i", '$1n\'t', $change);
$change = preg_replace("/\bfreebsd\b/", 'FreeBSD', $change);

// Match keywords against categories
$matched = false;
foreach ($categories as $cat => $header) {
// Purposefully ignored
if (preg_match("/^Merge (branch|pull request|remote-tracking branch) /", $change) or preg_match("/version bump/i", $change)) {
$matched = true;
continue;
}
// Groupings
if ((preg_match("/^" . $cat . ":/i", $change)) or (preg_match("/^\[" . $cat . "\//i", $change)) or (preg_match("/^\[" . $cat . "\]/i", $change)) or (preg_match("/^\[" . $cat . ":/i", $change)) or (preg_match("/^" . $cat . "\//i", $change)) or (preg_match("/^" . $cat . ":/i", $change))) {
if (!isset($catgroup[$header])) {
$catgroup[$header] = [];
}
$matched = true;
$catgroup[$header][] = preg_replace("/^\S+\s+/", "", $change);
break;
} else if (preg_match("/^" . $cat . " /i", $change)) {
if (!isset($catgroup[$header])) {
$catgroup[$header] = [];
}
$matched = true;
$catgroup[$header][] = $change;
break;
}
}
}

// Output tidy formatting
foreach ($catgroup as $cat => $list) {
echo "\n" . ($githubstyle ? '## ' : '__**') . $cat . ($githubstyle ? '' : '**__') . "\n";
foreach ($list as $item) {
// Exclude bad commit messages like 'typo fix', 'test push' etc by pattern
if (!preg_match("/^(typo|test|fix)\s\w+$/", $item)) {
echo ($githubstyle ? '-' : '•') . ' ' . ucfirst(str_replace('@','', $item)) . "\n";
}
}
echo "\n" . ($githubstyle ? '## ' : '__**') . $cat . ($githubstyle ? '' : '**__') . "\n";
foreach ($list as $item) {
// Exclude bad commit messages like 'typo fix', 'test push' etc by pattern
if (!preg_match("/^(typo|test|fix)\s\w+$/", $item)) {
echo ($githubstyle ? '-' : '•') . ' ' . ucfirst(str_replace('@', '', $item)) . "\n";
}
}
}

// Leadout
echo "\n\n**Thank you for using D++!**\n\n";
if (!$githubstyle) {
$version = $argv[2];
echo 'The ' . $version . ' download can be found here: <https://dl.dpp.dev/' . $version . '>';
echo "\n";
$version = $argv[2];
echo 'The ' . $version . ' download can be found here: <https://dl.dpp.dev/' . $version . '>';
echo "\n";
}

33 changes: 16 additions & 17 deletions buildtools/close-master-pr.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@
exec("gh pr list --base master | sed 's/\|/ /' |awk '{print $1}'", $master_prs);

foreach ($master_prs as $pr) {

$pr = (int)$pr;
if ($pr > 0) {
system("gh pr comment $pr -b \"You have opened a PR against the master branch. PRs must target the \`dev\` branch, as such this PR has been automatically closed. Please re-target your PR against the dev branch if you reopen it. Thank you for your contribution.\"");
system("gh pr close $pr");
}
$pr = (int)$pr;
if ($pr > 0) {
system("gh pr comment $pr -b \"You have opened a PR against the master branch. PRs must target the \`dev\` branch, as such this PR has been automatically closed. Please re-target your PR against the dev branch if you reopen it. Thank you for your contribution.\"");
system("gh pr close $pr");
}
}

// Tidy up the workflow run list so it isn't littered with these
exec("gh run list -w \"Close master-targeted PRs\"", $runs);
$runindex = 0;
foreach ($runs as $run) {
$run = preg_replace('/ /', ' ', $run);
$data = preg_split('/\s+/', $run);
$id = $data[sizeof($data) - 3];
$id = (int)$id;
if ($id > 0 && $runindex > 0) {
// Delete all but the first completed workflow run and this one
// (the first is the currently executing one!)
exec("gh api repos/brainboxdotcc/DPP/actions/runs/$id -X DELETE");
sleep(1);
}
$runindex++;
$run = preg_replace('/ /', ' ', $run);
$data = preg_split('/\s+/', $run);
$id = $data[sizeof($data) - 3];
$id = (int)$id;
if ($id > 0 && $runindex > 0) {
// Delete all but the first completed workflow run and this one
// (the first is the currently executing one!)
exec("gh api repos/brainboxdotcc/DPP/actions/runs/$id -X DELETE");
sleep(1);
}
$runindex++;
}
Loading