Skip to content

Commit

Permalink
CI: Updated coding style check. (#1738)
Browse files Browse the repository at this point in the history
* Always run `make cs` to check the coding style.
* Fixed HardwarePWM.
  • Loading branch information
slaff authored Jul 3, 2019
1 parent c6800a9 commit 28ef038
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 161 deletions.
13 changes: 10 additions & 3 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ unset ESPTOOL2

export SMING_HOME=$TRAVIS_BUILD_DIR/Sming

cd $SMING_HOME

# Check coding style
if [ "$TRAVIS_BUILD_STAGE_NAME" == "Test" ]; then
.travis/tools/clang/format-pr.sh;
make cs
DIFFS=$(git diff)
if [ "$DIFFS" != "" ]; then
echo "!!! Coding Style issues Found!!!"
echo " Run: 'make cs' to fix them. "
echo "$DIFFS"
exit 1
fi
fi

# Setup ARCH SDK paths
Expand All @@ -28,8 +37,6 @@ fi
# Full compile checks please
export STRICT=1

cd $SMING_HOME

# Move samples and tests into directory outside of the Sming repo.
export SMING_PROJECTS_DIR=$HOME/projects
mkdir $SMING_PROJECTS_DIR
Expand Down
121 changes: 0 additions & 121 deletions .travis/tools/clang/format-diff.py

This file was deleted.

28 changes: 0 additions & 28 deletions .travis/tools/clang/format-pr.sh

This file was deleted.

25 changes: 16 additions & 9 deletions Sming/Arch/Host/Core/HardwarePWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,38 @@

#include "HardwarePWM.h"

HardwarePWM::HardwarePWM(uint8* pins, uint8 no_of_pins) :
channel_count(no_of_pins) {
HardwarePWM::HardwarePWM(uint8* pins, uint8 no_of_pins) : channel_count(no_of_pins)
{
}

HardwarePWM::~HardwarePWM() {
HardwarePWM::~HardwarePWM()
{
}

uint8 HardwarePWM::getChannel(uint8 pin) {
uint8 HardwarePWM::getChannel(uint8 pin)
{
return PWM_BAD_CHANNEL;
}

uint32 HardwarePWM::getDutyChan(uint8 chan) {
uint32 HardwarePWM::getDutyChan(uint8 chan)
{
return 0;
}

bool HardwarePWM::setDutyChan(uint8 chan, uint32 duty, bool update) {
bool HardwarePWM::setDutyChan(uint8 chan, uint32 duty, bool update)
{
return false;
}

uint32 HardwarePWM::getPeriod() {
uint32 HardwarePWM::getPeriod()
{
return 0;
}

void HardwarePWM::setPeriod(uint32 period) {
void HardwarePWM::setPeriod(uint32 period)
{
}

void HardwarePWM::update() {
void HardwarePWM::update()
{
}

0 comments on commit 28ef038

Please sign in to comment.