:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
The following is a set of guidelines for contributing to NodeMCU on GitHub. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
It is appreciated if you raise an issue before you start changing NodeMCU, discussing the proposed change; emphasizing that you are proposing to develop the patch yourself, and outlining the strategy for implementation. This type of discussion is what we should be doing on the issues list and it is better to do this before or in parallel to developing the patch rather than having «you should have done it this way» type of feedback on the PR itself.
We are a friendly and welcoming community and look forward to your contributions. Once your contribution is integrated into this repository we feel responsible for it. Therefore, be prepared for constructive feedback. Before we merge anything we need to ensure that it fits in and is consistent with the rest of NodeMCU. If you made something really cool but won’t spend the time to integrate it into this upstream project please still share it in your fork on GitHub. If you mention it in an issue we’ll take a look at it anyway.
Use the platform and tools you feel most comfortable with. There are no constraints imposed by this project. You have (at least) two options to set up the toolchain to build the NodeMCU firmware:
The NodeMCU documentation is maintained within the same repository as the code. The primary reason is to keep the two in sync more easily. It’s thus trivial for the NodeMCU team to verify that a PR includes the necessary documentation. Furthermore, the documentation is merged automatically with the code if it moves from branch X to Y.
The documentation consists of a collection of Markdown files (see note on Markdown syntax at end of chapter) stored in the /docs
directory. With every commit, a human readable and browsable version is automatically built with Read the Docs (RTD). The public NodeMCU documentation can be found at nodemcu.readthedocs.io.
There are essentially only two things to keep in mind if you’re contributing a PR:
.md
file in /docs/en/modules
. Adhere to the existing documentation structure and keep functions in alphabetical order..md
file to mkdocs.yml
(lines 32+). Note that modules are ordered alphabetically here as well.If you also want to verify that all is well with your Markdown files you can install Python-based MkDocs, which is used by RTD to build the static HTML files, and run mkdocs serve
in the root of your NodeMCU firmware directory.
A note on Markdown syntax. As MkDocs is Python-based it’s no surprise it uses a Python Markdown implementation. The good news is that it sticks pretty closely to John Gruber’s Markdown and also supports tables and fenced code blocks just like GitHub does.
A collection of doc-writing hints and tips is maintained on the wiki.
If you’re interested in some NodeMCU history you’re welcome to read issue #774
Pull requests for new features and fixes should be opened against the dev
branch.
Avoid intermediate merge commits. Rebase your feature branch onto dev
to pull updates and verify your local changes against them before placing the pull request.
dev
branch.git clone https://github.com/<your-account>/<nodemcu-fork>.git
cd <nodemcu-fork>
then run git remote add upstream https://github.com/nodemcu/nodemcu-firmware.git
git checkout <branch-name>
git commit -a -m 'Look ma, I did it'
dev
running git rebase dev
.git push
This is just one way of doing things. If you’re proficient in Git matters you’re free to choose your own. If you want to read more then the GitHub chapter in the Git book is a way to start. GitHub’s own documentation contains a wealth of information as well.
You need to sync your fork with the NodeMCU upstream repository from time to time, latest before you rebase (see flow above).
git fetch upstream
git checkout dev
but you may do this for master
as wellgit merge upstream/dev
From: http://git-scm.com/book/ch5-2.html
Short (50 chars or less) summary of changesMore detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together.
Further paragraphs come after blank lines.
Bullet points are okay, too
Typically a hyphen or asterisk is used for the bullet, preceded by a single space, with blank lines in between, but conventions vary here
Don’t forget to reference affected issues in the commit message to have them closed automatically on GitHub.
Amend your commit messages if necessary to make sure what the world sees on GitHub is as expressive and meaningful as possible.
master
branch for collaborators to approve.git tag -a <SDK-version>-master_<yyyyMMdd> -m ""
, git push --tags