All of the code in this library (including examples and tools) tries to comply with various style guides. We also have a automated zero-tolerance for lint errors. All commits are subjected to automated style guide & lint checks as part of the checks. You should run these checks prior to committing or sending a PR etc.
uint16_t
instead of unsigned int
etc.
auto
in the library's core code as this can cause bit-wise issues that won't be detected in the Unit Tests. Use of auto
in the unit tests is fine.TL;DR: "What the job of a code reviewer entails is someone to check if the code looks sane, would be similar to how they would implement it, check for any obvious boo-boos, offer advice, and offer constructive criticism. A code review(er) is not responsible for making sure there are no bugs, or anything. They are never to blame if something goes wrong. All responsibility is with the code author basically. Not you. So there is little pressure." Quote ref
The Unit Tests which are under the test/ & tools/ directories are for a Unix machine, not the micro-controller (ESP8266). e.g. For GitHub Actions & the developer's workstation.
All internal library code must use c99 exact-width type definitions. e.g. uint16_t etc. You must disable any Arduino/ESP8266 specific code (e.g. Serial.print()
etc.) using something like:
#ifndef UNIT_TEST
<Arduino specific code ...>
#endif
The Unit Tests & Test Coverage are not perfect as we can not emulate hardware specific features and differences. e.g. Interrupts, GPIOs, CPU instruction timing etc, etc.
The example code has no unit tests.
To run the tests yourself, try the following:
$ cd test $ make install-googletest # Only ever needs to be run/installed once. $ make run_testsBefore you create a Pull Request
This library uses GitHub Actions to ensure all the tests & code style checks pass before allowing a commit/merge to the library. i.e. You might as well run them by hand before you commit your final code. There is no escaping these checks. The full battery of checks performed can be found in the library's .github/workflows/*.yml files. However, the Lazy Developer's guide is as follows.
Have you never run any of the library's tests before?$ # This all assumes you've got a linux machine with typical dev tools installed. e.g. gcc, g++, python, make, etc. $ sudo apt-get install pylint3 # Install the Python Linter $ sudo pip install platformio # PlatformIO is like the Arduino IDE. It will build/compile the code. $ pio update # Ensure PlatformIO is to date. $ wget https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py # Get the latest C++ linter. $ cd git/IRremoteESP8266/test $ make install-googletestDid you change a file under the examples directory?
$ cd git/IRremoteESP8266 $ cpplint --extensions=c,cc,cpp,ino,h --headers=h,hpp --count=total --verbose=2 {src,src/locale,test,tools}/*.{h,c,cc,cpp,hpp,ino} examples/*/*.{h,c,cc,cpp,hpp,ino}
or
$ cd git/IRremoteESP8266 $ wget https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py $ python ./cpplint.py --extensions=c,cc,cpp,ino --headers=h,hpp {src,src/locale,test,tools}/*.{h,c,cc,cpp,hpp,ino} examples/*/*.{h,c,cc,cpp,hpp,ino}Did you change a file ending in
*.h
or *.cpp
that was not under the examples directory?
$ cd test $ make install-googletest # Only ever needs to be run/installed once. $ make run_testsDid you change anything under the tools directory?
$ cd tools $ make run_testsDid you change a file ending in
*.py
?
$ sudo apt-get install pylint3 # Note: Only needs to be installed/run once. $ cd git/IRremoteESP8266 $ pylint3 -d F0001 {src,test,tools}/*.pyHave you added a new
ir_*.cpp
etc file?
$ cd test
$ make run_tests
$ cd ../tools
$ make run_tests
Merging your Pull Request
To reduce useless noise in the commit log, please use Squash and Merge option to reduce your PR into a single commit before it is merged into the main code branch.
New version release checklistgit fetch origin git checkout master git reset --hard origin/master git clean -f -d
git checkout -b vXX.YY.ZZ
Where vXX.YY.ZZ is the new version string. e.g. v2.3.2rm -rf docs/doxygen/html doxygen
git add docs/doxygen/html git commit -m "Regenerate Doxygen documentation for new release"
_IRREMOTEESP8266_VERSION_(MAJOR|MINOR|PATCH)
in src/IRremoteESP8266.h
to the new version number.version
in library.json
& version=
in library.properties
accordingly.README.md
& README_??.md
.ReleaseNotes.md
and add a new section for the new release.
git log
should show you the change history.tools/mkkeywords > keywords.txt
from the top directory. (Requires a Linux machine etc)tools/scrape_supported_devices.py
from the top directory. (Requires Python3)git diff
and review the changes are what you expect.git commit -a
and create an appropriate entry. e.g. "v2.3.2 release"git push --set-upstream origin vXX.YY.ZZ
ReleaseNotes.md
as the PR comment.Tag Version
: vXX.YY.ZZTarget
: MasterRelease title
: IRremoteESP8266 vXX.YY.ZZNotes
: Cut & paste from the ReleaseNotes.md
update.git fetch git checkout gh-pages git reset --hard origin/gh-pages git clean -f -d git merge -s subtree origin/master git push
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4