Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
4pplet committed Apr 2, 2022
2 parents 1fd4987 + 4f30b7a commit ff49df5
Show file tree
Hide file tree
Showing 6,123 changed files with 84,231 additions and 43,962 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignOperands: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
Expand All @@ -20,6 +23,7 @@ SortIncludes: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: 1
TabWidth: '4'
UseTab: Never

Expand Down
25 changes: 12 additions & 13 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ assignees: ''

## System Information

- Keyboard:
- Revision (if applicable):
- Operating system:
- AVR GCC version:
<!-- Run `avr-gcc --version` to find this out. -->
- ARM GCC version:
<!-- Run `arm-none-eabi-gcc --version` to find this out. -->
- QMK Firmware version:
<!-- Run `git describe --abbrev=0 --tags` to find this out. -->
- Any keyboard related software installed?
- [ ] AutoHotKey
- [ ] Karabiner
- [ ] Other:
**Keyboard:**
**Revision (if applicable):**
**Operating system:**
**`qmk doctor` output:**
```
(Paste output here)
```

**Any keyboard related software installed?**
- [ ] AutoHotKey (Windows)
- [ ] Karabiner (macOS)
- [ ] Other:

## Additional Context

Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/auto_approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Automatic Approve

on:
schedule:
- cron: "*/5 * * * *"

jobs:
automatic_approve:
runs-on: ubuntu-latest

steps:
uses: mheap/automatic-approve-action@v1
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
workflows: "format.yml,lint.yml,unit_test.yml"
dangerous_files: "lib/python/,Makefile,paths.mk,builddefs/"
9 changes: 1 addition & 8 deletions .github/workflows/develop_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- master


jobs:
develop_update:
runs-on: ubuntu-latest
Expand All @@ -15,21 +14,15 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
fetch-depth: 0

- name: Checkout develop
run: |
git fetch origin master develop
git checkout develop
- name: Check if branch locked
id: check_locked
uses: andstor/file-existence-action@v1
with:
files: ".locked"

- name: Update develop from master
if: steps.check_locked.outputs.files_exists == 'false'
run: |
git config --global user.name "QMK Bot"
git config --global user.email "[email protected]"
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/feature_branch_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Update feature branches after develop merge

on:
push:
branches:
- develop

jobs:
feature_branch_update:
runs-on: ubuntu-latest

if: github.repository == 'qmk/qmk_firmware'

strategy:
matrix:
branch:
- xap

steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
fetch-depth: 0

- name: Checkout branch
run: |
git fetch origin develop ${{ matrix.branch }}
git checkout ${{ matrix.branch }}
- name: Update branch from develop
run: |
git config --global user.name "QMK Bot"
git config --global user.email "[email protected]"
git merge origin/develop
git push origin ${{ matrix.branch }}
9 changes: 4 additions & 5 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ jobs:
container: qmkfm/qmk_cli

steps:
- name: Install dependencies
run: |
apt-get update && apt-get install -y dos2unix
pip3 install -r requirements-dev.txt
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install dependencies
run: |
pip3 install -r requirements-dev.txt
- uses: trilom/[email protected]
id: file_changes
with:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/format_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ jobs:
container: qmkfm/qmk_cli

steps:
- name: Install dependencies
run: |
apt-get update && apt-get install -y dos2unix
pip3 install -r requirements-dev.txt
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install dependencies
run: |
pip3 install -r requirements-dev.txt
- name: Run qmk formatters
shell: 'bash {0}'
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.swp
*~
.DS_Store
._*

# Build artifacts
.clang_complete
Expand Down
133 changes: 38 additions & 95 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ endif
# Otherwise the [OK], [ERROR] and [WARN] messages won't be displayed correctly
override SILENT := false

ifdef SKIP_VERSION
SKIP_GIT := yes
endif

ifndef SUB_IS_SILENT
ifndef SKIP_GIT
QMK_VERSION := $(shell git describe --abbrev=0 --tags 2>/dev/null)
Expand Down Expand Up @@ -50,47 +54,11 @@ ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE))
ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE))
ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE))
STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR))
BUILD_DIR := $(ROOT_DIR)/.build
TEST_DIR := $(BUILD_DIR)/test
ERROR_FILE := $(BUILD_DIR)/error_occurred

# Helper function to process the newt element of a space separated path
# It works a bit like the traditional functional head tail
# so the CURRENT_PATH_ELEMENT will become the new head
# and the PATH_ELEMENTS are the rest that are still unprocessed
define NEXT_PATH_ELEMENT
$$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS)))
$$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS)))
endef

# We change the / to spaces so that we more easily can work with the elements
# separately
PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
# Initialize the path elements list for further processing
$(eval $(call NEXT_PATH_ELEMENT))


# Phony targets to enable a few simple make commands outside the main processing below.
.PHONY: list-keyboards
list-keyboards:
util/list_keyboards.sh | sort -u | tr '\n' ' '

.PHONY: generate-keyboards-file
generate-keyboards-file:
util/list_keyboards.sh | sort -u

.PHONY: clean
clean:
echo -n 'Deleting .build/ ... '
rm -rf $(BUILD_DIR)
echo 'done.'

.PHONY: distclean
distclean: clean
echo -n 'Deleting *.bin, *.hex, and *.uf2 ... '
rm -f *.bin *.hex *.uf2
echo 'done.'
include paths.mk

TEST_OUTPUT_DIR := $(BUILD_DIR)/test
ERROR_FILE := $(BUILD_DIR)/error_occurred

.DEFAULT_GOAL := all:all

Expand Down Expand Up @@ -119,53 +87,20 @@ endef
# a function that returns the value
COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND)


# Recursively try to find a match for the start of the rule to be checked
# $1 The list to be checked
# If a match is found, then RULE_FOUND is set to true
# and MATCHED_ITEM to the item that was matched
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER3
ifneq ($1,)
ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true)
MATCHED_ITEM := $$(firstword $1)
else
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$$(wordlist 2,9999,$1)))
endif
endif
endef

# A recursive helper function for finding the longest match
# $1 The list to be checked
# It works by always removing the currently matched item from the list
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
# Stop the recursion when the list is empty
ifneq ($1,)
RULE_BEFORE := $$(RULE)
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1))
# If a match is found in the current list, otherwise just return what we had before
ifeq ($$(RULE_FOUND),true)
# Save the best match so far and call itself recursively
BEST_MATCH := $$(MATCHED_ITEM)
BEST_MATCH_RULE := $$(RULE)
RULE_FOUND := false
RULE := $$(RULE_BEFORE)
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$$(filter-out $$(MATCHED_ITEM),$1)))
endif
endif
endef


# Recursively try to find the longest match for the start of the rule to be checked
# Try to find a match for the start of the rule to be checked
# $1 The list to be checked
# If a match is found, then RULE_FOUND is set to true
# and MATCHED_ITEM to the item that was matched
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER
BEST_MATCH :=
$$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$1))
ifneq ($$(BEST_MATCH),)
# Split on ":", padding with empty strings to avoid indexing issues
TOKEN1:=$$(shell python3 -c "import sys; print((sys.argv[1].split(':',1)+[''])[0])" $$(RULE))
TOKENr:=$$(shell python3 -c "import sys; print((sys.argv[1].split(':',1)+[''])[1])" $$(RULE))

FOUNDx:=$$(shell echo $1 | tr " " "\n" | grep -Fx $$(TOKEN1))
ifneq ($$(FOUNDx),)
RULE := $$(TOKENr)
RULE_FOUND := true
RULE := $$(BEST_MATCH_RULE)
MATCHED_ITEM := $$(BEST_MATCH)
MATCHED_ITEM := $$(TOKEN1)
else
RULE_FOUND := false
MATCHED_ITEM :=
Expand Down Expand Up @@ -340,7 +275,7 @@ define PARSE_KEYMAP
# Specify the variables that we are passing forward to submake
MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) REQUIRE_PLATFORM_KEY=$$(REQUIRE_PLATFORM_KEY) QMK_BIN=$$(QMK_BIN)
# And the first part of the make command
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET)
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_keyboard.mk $$(MAKE_TARGET)
# The message to display
MAKE_MSG := $$(MSG_MAKE_KB)
# We run the command differently, depending on if we want more output or not
Expand Down Expand Up @@ -382,12 +317,12 @@ define BUILD_TEST
TEST_NAME := $$(notdir $$(TEST_PATH))
MAKE_TARGET := $2
COMMAND := $1
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_test.mk $$(MAKE_TARGET)
MAKE_VARS := TEST=$$(TEST_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)"
MAKE_MSG := $$(MSG_MAKE_TEST)
$$(eval $$(call BUILD))
ifneq ($$(MAKE_TARGET),clean)
TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
TEST_EXECUTABLE := $$(TEST_OUTPUT_DIR)/$$(TEST_NAME).elf
TESTS += $$(TEST_NAME)
TEST_MSG := $$(MSG_TEST)
$$(TEST_NAME)_COMMAND := \
Expand All @@ -404,6 +339,7 @@ define PARSE_TEST
TESTS :=
TEST_NAME := $$(firstword $$(subst :, ,$$(RULE)))
TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME):,,$$(RULE)))
include $(BUILDDEFS_PATH)/testlist.mk
ifeq ($$(TEST_NAME),all)
MATCHED_TESTS := $$(TEST_LIST)
else
Expand All @@ -426,7 +362,6 @@ define SET_SILENT_MODE
endif
endef

include paths.mk
include $(BUILDDEFS_PATH)/message.mk

ifeq ($(strip $(BREAK_ON_ERRORS)), yes)
Expand Down Expand Up @@ -496,14 +431,22 @@ git-submodule:
git submodule sync --recursive
git submodule update --init --recursive --progress

# Generate the version.h file
ifdef SKIP_GIT
VERSION_H_FLAGS := --skip-git
endif
ifdef SKIP_VERSION
VERSION_H_FLAGS := --skip-all
SKIP_GIT := yes
endif
$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o quantum/version.h)
.PHONY: list-keyboards
list-keyboards:
util/list_keyboards.sh | sort -u | tr '\n' ' '

.PHONY: generate-keyboards-file
generate-keyboards-file:
util/list_keyboards.sh | sort -u

.PHONY: clean
clean:
echo -n 'Deleting .build/ ... '
rm -rf $(BUILD_DIR)
echo 'done.'

include $(ROOT_DIR)/testlist.mk
.PHONY: distclean
distclean: clean
echo -n 'Deleting *.bin, *.hex, and *.uf2 ... '
rm -f *.bin *.hex *.uf2
echo 'done.'
Loading

0 comments on commit ff49df5

Please sign in to comment.