Skip to content

Commit

Permalink
Added clang-format (#623)
Browse files Browse the repository at this point in the history
* added .clang-format
* added names to travis jobs
removed deprecated travis option
* check github action
* added .gitignore
  • Loading branch information
Legion2 authored Jun 9, 2020
1 parent 661ef9c commit 10a9d00
Show file tree
Hide file tree
Showing 59 changed files with 2,898 additions and 3,646 deletions.
14 changes: 14 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BasedOnStyle: Google
Language: Cpp
ColumnLimit: 0
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentPPDirectives: AfterHash
ReflowComments: false
SpacesBeforeTrailingComments: 1
AlignConsecutiveMacros: true
AlignTrailingComments: false
AccessModifierOffset: -2
DerivePointerAlignment: false
PointerAlignment: Left
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check Code Format

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Check main format
uses: DoozyX/[email protected]
with:
source: "./main"
extensions: "h,ino"
clangFormatVersion: 9
- name: Check test format
uses: DoozyX/[email protected]
with:
source: "./test"
extensions: "h,ino"
clangFormatVersion: 9
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.pio
.vscode
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@
# Travis CI documentation (see above).
#


#
# Template #1: General project. Test it using existing `platformio.ini`.
#
matrix:
jobs:
include:
- language: python
- name: "Build and deploy with PlatformIO"
language: python
python: 2.7
sudo: false
cache:
directories:
- "~/.platformio"
directories:
- "~/.platformio"
install:
- pip install -U platformio
- platformio update
script:
script:
- sed -i 's/version_tag/'$TRAVIS_TAG'/g' main/User_config.h
- platformio run
- bash scripts/prepare_deploy.sh
Expand All @@ -52,7 +51,8 @@ matrix:
- toDeploy/*
skip_cleanup: true

- language: node_js
- name: "Build and deploy docs"
language: node_js
node_js:
- lts/*
install:
Expand All @@ -63,10 +63,10 @@ matrix:
before_deploy: echo "docs.openmqttgateway.com" >> docs/.vuepress/dist/CNAME
deploy:
provider: pages
skip-cleanup: true
skip_cleanup: true
local_dir: docs/.vuepress/dist
github-token: $GITHUB_TOKEN # a token generated on github allowing travis to push code on you repository
keep-history: true
github_token: $GITHUB_TOKEN # a token generated on github allowing travis to push code on you repository
keep_history: true
on:
repo: 1technophile/OpenMQTTGateway
all_branches: true
Expand Down
Loading

0 comments on commit 10a9d00

Please sign in to comment.