Skip to content

Commit

Permalink
feat(pre-commit): support to check file versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lzw655 committed Jun 1, 2024
1 parent ec4efdc commit 9cdc53e
Show file tree
Hide file tree
Showing 26 changed files with 357 additions and 160 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Versions
name: Check Library Versions

on:
pull_request:
Expand Down Expand Up @@ -26,5 +26,5 @@ jobs:
echo "prerelease: ${{ steps.last_release.outputs.prerelease }}"
echo "url: ${{ steps.last_release.outputs.url }}"
- name: Check & Compare versions
run: bash ./.github/scripts/check_versions.sh ${{ steps.last_release.outputs.tag_name }}
run: bash ./.github/scripts/check_lib_versions.sh ${{ steps.last_release.outputs.tag_name }}

10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ repos:
hooks:
- id: sync-conf-files
name: Update when configuration files change
entry: python .github/ci/sync_conf_files.py ./
entry: python tools/sync_conf_files.py ./
language: system
files: '.*ESP_Panel_(Board_Custom|Board_Supported|Conf)\.h'

- repo: local
hooks:
- id: check-file-versions
name: Update when versions change
entry: python tools/check_file_version.py ./
language: system
files: '(.*ESP_Panel_(Board_Custom|Board_Supported|Conf)\.h|library.properties|.*ESP_PanelVersions.h)'
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# ChangeLog

## v0.1.2 - 2024-05-27
## v0.1.2 - 2024-06-01

### Enhancements:

* feat(config): add version control for all configuration files by @lzw655 (#32)
* feat(touch): add i2c st1633 by @lzw655 (#22)
* feat(pre-commit): support to check file versions

### Bugfixes:

Expand Down
2 changes: 1 addition & 1 deletion ESP_Panel_Board_Custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
*/
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1

#endif /* ESP_PANEL_USE_CUSTOM_BOARD */

Expand Down
26 changes: 14 additions & 12 deletions ESP_Panel_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@

#pragma once

/**
* Debug configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////// Debug Configurations /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Set to 1 if assert on error. Otherwise print error message */
#define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1

/* Set to 1 if print log message for debug */
#define ESP_PANEL_ENABLE_LOG (0) // 0/1

/**
* Touch driver configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////// Touch Driver Configurations //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Maximum point number */
#define ESP_PANEL_TOUCH_MAX_POINTS (5)

/* Maximum button number */
#define ESP_PANEL_TOUCH_MAX_BUTTONS (1)

/* Model configurations */
// XPT2046
/**
* XPT2046 related
*
*/
#define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold
/**
* Enable Interrupt (PENIRQ) output, also called Full Power Mode.
Expand Down Expand Up @@ -59,6 +58,9 @@
*/
#define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Do not change the following versions, they are used to check if the configurations in this file are compatible with
* the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows:
Expand All @@ -72,4 +74,4 @@
*/
#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0
#define ESP_PANEL_CONF_FILE_VERSION_MINOR 1
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1
26 changes: 14 additions & 12 deletions examples/LCD/3wireSPI_RGB/ESP_Panel_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@

#pragma once

/**
* Debug configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////// Debug Configurations /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Set to 1 if assert on error. Otherwise print error message */
#define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1

/* Set to 1 if print log message for debug */
#define ESP_PANEL_ENABLE_LOG (0) // 0/1

/**
* Touch driver configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////// Touch Driver Configurations //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Maximum point number */
#define ESP_PANEL_TOUCH_MAX_POINTS (5)

/* Maximum button number */
#define ESP_PANEL_TOUCH_MAX_BUTTONS (1)

/* Model configurations */
// XPT2046
/**
* XPT2046 related
*
*/
#define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold
/**
* Enable Interrupt (PENIRQ) output, also called Full Power Mode.
Expand Down Expand Up @@ -59,6 +58,9 @@
*/
#define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Do not change the following versions, they are used to check if the configurations in this file are compatible with
* the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows:
Expand All @@ -72,4 +74,4 @@
*/
#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0
#define ESP_PANEL_CONF_FILE_VERSION_MINOR 1
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1
26 changes: 14 additions & 12 deletions examples/LCD/QSPI/ESP_Panel_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@

#pragma once

/**
* Debug configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////// Debug Configurations /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Set to 1 if assert on error. Otherwise print error message */
#define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1

/* Set to 1 if print log message for debug */
#define ESP_PANEL_ENABLE_LOG (0) // 0/1

/**
* Touch driver configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////// Touch Driver Configurations //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Maximum point number */
#define ESP_PANEL_TOUCH_MAX_POINTS (5)

/* Maximum button number */
#define ESP_PANEL_TOUCH_MAX_BUTTONS (1)

/* Model configurations */
// XPT2046
/**
* XPT2046 related
*
*/
#define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold
/**
* Enable Interrupt (PENIRQ) output, also called Full Power Mode.
Expand Down Expand Up @@ -59,6 +58,9 @@
*/
#define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Do not change the following versions, they are used to check if the configurations in this file are compatible with
* the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows:
Expand All @@ -72,4 +74,4 @@
*/
#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0
#define ESP_PANEL_CONF_FILE_VERSION_MINOR 1
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1
26 changes: 14 additions & 12 deletions examples/LCD/RGB/ESP_Panel_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@

#pragma once

/**
* Debug configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////// Debug Configurations /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Set to 1 if assert on error. Otherwise print error message */
#define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1

/* Set to 1 if print log message for debug */
#define ESP_PANEL_ENABLE_LOG (0) // 0/1

/**
* Touch driver configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////// Touch Driver Configurations //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Maximum point number */
#define ESP_PANEL_TOUCH_MAX_POINTS (5)

/* Maximum button number */
#define ESP_PANEL_TOUCH_MAX_BUTTONS (1)

/* Model configurations */
// XPT2046
/**
* XPT2046 related
*
*/
#define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold
/**
* Enable Interrupt (PENIRQ) output, also called Full Power Mode.
Expand Down Expand Up @@ -59,6 +58,9 @@
*/
#define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Do not change the following versions, they are used to check if the configurations in this file are compatible with
* the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows:
Expand All @@ -72,4 +74,4 @@
*/
#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0
#define ESP_PANEL_CONF_FILE_VERSION_MINOR 1
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1
26 changes: 14 additions & 12 deletions examples/LCD/SPI/ESP_Panel_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@

#pragma once

/**
* Debug configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////// Debug Configurations /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Set to 1 if assert on error. Otherwise print error message */
#define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1

/* Set to 1 if print log message for debug */
#define ESP_PANEL_ENABLE_LOG (0) // 0/1

/**
* Touch driver configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////// Touch Driver Configurations //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Maximum point number */
#define ESP_PANEL_TOUCH_MAX_POINTS (5)

/* Maximum button number */
#define ESP_PANEL_TOUCH_MAX_BUTTONS (1)

/* Model configurations */
// XPT2046
/**
* XPT2046 related
*
*/
#define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold
/**
* Enable Interrupt (PENIRQ) output, also called Full Power Mode.
Expand Down Expand Up @@ -59,6 +58,9 @@
*/
#define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Do not change the following versions, they are used to check if the configurations in this file are compatible with
* the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows:
Expand All @@ -72,4 +74,4 @@
*/
#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0
#define ESP_PANEL_CONF_FILE_VERSION_MINOR 1
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1
2 changes: 1 addition & 1 deletion examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
*/
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1

#endif /* ESP_PANEL_USE_CUSTOM_BOARD */

Expand Down
26 changes: 14 additions & 12 deletions examples/LVGL/v8/Porting/ESP_Panel_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@

#pragma once

/**
* Debug configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////// Debug Configurations /////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Set to 1 if assert on error. Otherwise print error message */
#define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1

/* Set to 1 if print log message for debug */
#define ESP_PANEL_ENABLE_LOG (0) // 0/1

/**
* Touch driver configurations
*
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////// Touch Driver Configurations //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Maximum point number */
#define ESP_PANEL_TOUCH_MAX_POINTS (5)

/* Maximum button number */
#define ESP_PANEL_TOUCH_MAX_BUTTONS (1)

/* Model configurations */
// XPT2046
/**
* XPT2046 related
*
*/
#define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold
/**
* Enable Interrupt (PENIRQ) output, also called Full Power Mode.
Expand Down Expand Up @@ -59,6 +58,9 @@
*/
#define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// File Version ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Do not change the following versions, they are used to check if the configurations in this file are compatible with
* the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows:
Expand All @@ -72,4 +74,4 @@
*/
#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0
#define ESP_PANEL_CONF_FILE_VERSION_MINOR 1
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1
2 changes: 1 addition & 1 deletion examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
*/
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1

#endif /* ESP_PANEL_USE_CUSTOM_BOARD */

Expand Down
Loading

0 comments on commit 9cdc53e

Please sign in to comment.