blascarr/esp-platformio icon
public
Published on 4/5/2025
Sample rule

These rules are designed to standardize development practices for projects utilizing ESP32 and ESP8266 boards within the PlatformIO environment.

Rules
esp-platformio
## Build & Development Commands
The project is using ESP32 and ESP8266 boards or other boards with Wifi connection.

# Compilation

The project is using Platformio enviroment and it should use configurations for different board compilation based on platformio.ini


# ESP8266 and ESP32 differences

Some libraries for ESP8266 and ESP32 could be different and code may be sometimes adapted to work with both. 

## Build & Development Commands
The project utilizes the PlatformIO environment. Ensure that configurations focused ondifferent board compilations are specified in the platformio.ini file.

## Testing Guidelines
Unit Tests: Utilize the Unity framework for unit testing. Execute unit tests exclusively within the setup() function to ensure a controlled testing environment.
Integration Tests: Implement integration tests by executing actions within the loop() function. Use the Ticker library to schedule test executions at intervals until the test suite completes.

## Code Style & Guidelines 
Language Standard: Adhere to the C++11 standard for all code.
Utilize standard C++ structures such as map and vector to enhance code organization and efficiency.
Naming Conventions: Use descriptive and consistent naming conventions for variables, functions, and classes to improve code readability and maintainability.

## Documentation Guidelines 
API Documentation: If the project exposes an API, ensure comprehensive documentation is provided, including endpoints, request/response formats, and example usage.