As of Q4 2023, Fuchsia does not automatically enforce coding standards on Python code and fix/flag the CL during development/review process.
Many teams across Fuchsia (and potentially third party vendors such as driver development):
To help facilitate #1, Honeydew relies on having solid unit test and functional test coverage.
To help facilitate #2, Honeydew relies on Google Python Style Guide (which contains a list of dos and don’ts for Python programs).
As of Q4 2023, Fuchsia does not automatically enforce coding standards on Python code and fix/flag the CL during development/review process.
All the tools needed to enforce coding standards on Python code will be integrated into Fuchsia developer workflow and will be run automatically in CQ/Pre-Submit.
Until that point, the Lacewing team has created below guidelines that need to be followed by everyone while contributing to Honeydew. Following these guidelines will ensure code is well tested, consistent and readable before it is merged.
We understand it's difficult to meet these requirements without automated enforcement. Please bear with us while we roll out the appropriate automated checks.
<device>.reboot()
actually reboots Fuchsia device) which can’t be ensured using unit test casesTo ease the development workflow, we have automated checking for these guidelines (everything except functional test cases). Users should run this script and fix any errors it suggests.
These guidelines need to be checked at the least on the following patchsets:
On all other patchsets, it is recommended but optional to check these guidelines.
Note - Prior to running this, please make sure to follow the Honeydew Setup.
Run cd $FUCHSIA_DIR && sh $FUCHSIA_DIR/src/testing/end_to_end/honeydew/scripts/conformance.sh
and fix any errors it suggests.
Once the script has completed successfully, it will print output similar to the following:
INFO: Honeydew code has passed all of the conformance steps
This script will run the following scripts in same sequence:
Note - Prior to running this, please make sure to follow the Honeydew Setup.
Running cd $FUCHSIA_DIR && sh $FUCHSIA_DIR/src/testing/end_to_end/honeydew/scripts/install.sh
will install Honeydew
Running cd $FUCHSIA_DIR && sh $FUCHSIA_DIR/src/testing/end_to_end/honeydew/scripts/uninstall.sh
will uninstall Honeydew
Run cd $FUCHSIA_DIR && sh $FUCHSIA_DIR/src/testing/end_to_end/honeydew/scripts/format.sh
and fix any errors it suggests.
Run cd $FUCHSIA_DIR && sh $FUCHSIA_DIR/src/testing/end_to_end/honeydew/scripts/coverage.sh
which will show comprehensive coverage on the entire Honeydew codebase.
For a targeted report on only the locally modified files, run the command above with the --affected
flag and fix any errors it suggests.