mirror of
https://github.com/esphome/esphome.git
synced 2025-06-21 15:55:39 +01:00
Run clang-tidy against Arduino 3 (#2146)
* Add macros header with more usable Arduino version defines * Change Arduino version checking to use our version defines * Add missing ESP8266 check * Rename Arduino version macro to ARDUINO_VERSION_CODE * Upgrade clang-tidy to use Arduino 3 * Fix clang-tidy warnings * Upgrade NeoPixelBus to upstream 2.6.7 * Use Arduino-version-appropriate API to set redirect flags * Remove now unnecessary CLANG_TIDY ifdefs * Add preprocessor hackery to avoid including pgmspace.h * Bump base image to 4.1.1 and update lint * Fix nfctag * Fix make_unique ambiguous * Fix ignore name * Fix ambiguous v2 * Remove unused begin * Cast time_t to prevent issues on platforms where time_t is 32bit Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
.clang-tidyplatformio.ini
.github/workflows
docker
esphome
components
adc
debug
deep_sleep
http_request
light
neopixelbus
nextion
nfc
pn532
sgp40
shutdown
spi
time
uart
web_server_base
core
script
@ -27,6 +27,21 @@ def clang_options(idedata):
|
||||
# disable built-in include directories from the host
|
||||
'-nostdinc',
|
||||
'-nostdinc++',
|
||||
# replace pgmspace.h, as it uses GNU extensions clang doesn't support
|
||||
# https://github.com/earlephilhower/newlib-xtensa/pull/18
|
||||
'-D_PGMSPACE_H_',
|
||||
'-Dpgm_read_byte(s)=(*(const uint8_t *)(s))',
|
||||
'-Dpgm_read_byte_near(s)=(*(const uint8_t *)(s))',
|
||||
'-Dpgm_read_dword(s)=(*(const uint32_t *)(s))',
|
||||
'-DPROGMEM=',
|
||||
'-DPGM_P=const char *',
|
||||
'-DPSTR(s)=(s)',
|
||||
# this next one is also needed with upstream pgmspace.h
|
||||
# suppress warning about identifier naming in expansion of this macro
|
||||
'-DPSTRN(s, n)=(s)',
|
||||
# suppress warning about attribute cannot be applied to type
|
||||
# https://github.com/esp8266/Arduino/pull/8258
|
||||
'-Ddeprecated(x)=',
|
||||
# pretend we're an Xtensa compiler, which gates some features in the headers
|
||||
'-D__XTENSA__',
|
||||
# allow to condition code on the presence of clang-tidy
|
||||
|
Reference in New Issue
Block a user