Skip to content

Commit

Permalink
Format code, update to Qt 6.7.0 & attend issue #189
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-spataru committed May 5, 2024
1 parent d4f7fbc commit 2684aca
Show file tree
Hide file tree
Showing 669 changed files with 89,028 additions and 89,127 deletions.
96 changes: 20 additions & 76 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
# Copyright (C) 2016 Olivier Goffart <[email protected]>
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
BasedOnStyle: LLVM
Standard: Cpp11
CommentPragmas: "^!|^:"
PointerBindsToType: false
SpaceAfterTemplateKeyword: false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
ConstructorInitializerIndentWidth: 2
NamespaceIndentation: None
AlignAfterOpenBracket: true
AlwaysBreakTemplateDeclarations: true
AllowShortFunctionsOnASingleLine: Inline
SortIncludes: false
IndentCaseLabels: true
IndentPPDirectives: AfterHash
AccessModifierOffset: -2
IndentWidth: 2
ColumnLimit: 80

# This is the clang-format configuration style to be used by Qt,
# based on the rules from https://wiki.qt.io/Qt_Coding_Style and
# https://wiki.qt.io/Coding_Conventions

---
# Webkit style was loosely based on the Qt style
BasedOnStyle: WebKit

Standard: Cpp11

# Leave the line breaks up to the user.
# Note that this may be changed at some point in the future.
ColumnLimit: 0
# How much weight do extra characters after the line length limit have.
# PenaltyExcessCharacter: 4

# Disable reflow of qdoc comments: indentation rules are different.
# Translation comments are also excluded.
CommentPragmas: "^!|^:"

# We want a space between the type and the star for pointer types.
PointerBindsToType: false

# We use template< without space.
SpaceAfterTemplateKeyword: false

# We want to break before the operators, but not before a '='.
BreakBeforeBinaryOperators: All

# Braces are usually attached, but not after functions or class declarations.
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
Expand All @@ -47,48 +32,7 @@ BraceWrapping:
BeforeElse: true
IndentBraces: false

BreakBeforeTernaryOperators: true

BreakConstructorInitializers: BeforeComma

# Indent initializers by 3 spaces
ConstructorInitializerIndentWidth: 4

# No indentation for namespaces.
NamespaceIndentation: None

# Horizontally align arguments after an open bracket.
# The coding style does not specify the following, but this is what gives
# results closest to the existing code.
AlignAfterOpenBracket: true
AlwaysBreakTemplateDeclarations: true

# Ideally we should also allow less short function in a single line, but
# clang-format does not handle that.
AllowShortFunctionsOnASingleLine: Inline

# The coding style specifies some include order categories, but also tells to
# separate categories with an empty line. It does not specify the order within
# the categories. Since the SortInclude feature of clang-format does not
# re-order includes separated by empty lines, the feature is not used.
SortIncludes: false

# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]

IndentCaseLabels: true

IndentPPDirectives: AfterHash

AlignAfterOpenBracket: Align

AccessModifierOffset: -4

IndentWidth: 4

#StatementMacros ['Q_OBJECT', 'Q_UNUSED']

ColumnLimit: 90



56 changes: 56 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*,-llvmlibc-*'
CheckOptions: [{ key: misc-non-private-member-variables-in-classes, value: IgnoreClassesWithAllMemberVariablesBeingPublic }]
WarningsAsErrors: '*'
HeaderFilterRegex: ''
FormatStyle: none

CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassMemberCase
value: lower_case
- key: readability-identifier-naming.ConstexprVariableCase
value: CamelCase
- key: readability-identifier-naming.ConstexprVariablePrefix
value: k
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantPrefix
value: k
- key: readability-identifier-naming.FunctionCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantPrefix
value: k
- key: readability-identifier-naming.StaticConstantCase
value: CamelCase
- key: readability-identifier-naming.StaticConstantPrefix
value: k
- key: readability-identifier-naming.StaticVariableCase
value: lower_case
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.MacroDefinitionIgnoredRegexp
value: '^[A-Z]+(_[A-Z]+)*_$'
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
- key: readability-identifier-naming.PublicMemberSuffix
value: ''
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.TypeAliasCase
value: CamelCase
- key: readability-identifier-naming.TypedefCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: 1
79 changes: 59 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Workflow configuration
#--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------

name: Deploy
on:
Expand All @@ -12,9 +12,9 @@ on:
paths-ignore: # File-patterns to ignore
- '**.md' # Ignore changes to *.md files

#--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Define application name & version
#--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------

env:
VERSION: "2.0.0"
Expand All @@ -26,14 +26,14 @@ env:
QML_DIR_WIN: "assets\\qml"
PUBLISHER: "Alex Spataru"
REPO_DIR: "/home/runner/work/Serial-Studio"
QT_VERSION: 6.6.2
QT_MODULES: qtserialport qtconnectivity qt5compat qtpositioning qtlocation
QT_VERSION: 6.7.0
QT_MODULES: qtserialport qtconnectivity qtpositioning qtlocation
QMAKE: qmake6
CORES: 16

#--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Workflow jobs (GNU/Linux, macOS & Windows)
#--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------

jobs:
#
Expand All @@ -60,12 +60,15 @@ jobs:
- name: '⚙️ Install dependencies'
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libzstd-dev libxcb-image0-dev libxcb-util0-dev libxcb-cursor-dev
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-render-util0 \
libxcb-xinerama0 libzstd-dev libxcb-image0-dev \
libxcb-util0-dev libxcb-cursor-dev
- name: '🚧 Compile application'
run: |
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
make -j${{env.CORES}}
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
make -j${{env.CORES}}
- name: '⚙️ Install linuxdeploy'
run: |
Expand Down Expand Up @@ -109,24 +112,58 @@ jobs:
version: ${{env.QT_VERSION}}
modules: ${{env.QT_MODULES}}
cache: true
arch: clang_64
install-deps: 'true'

- name: '⚙️ Install Node'
uses: actions/setup-node@v4
with:
node-version: 20

- name: '🚧 Compile application'
run: |
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
make -j${{env.CORES}}
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release
make -j${{env.CORES}}
- name: '📦 Package application (macdeployqt and zipfile)'
- name: '📦 Package application'
run: |
macdeployqt ${{env.EXECUTABLE}}.app -qmldir="${{env.QML_DIR_NIX}}"
mv "${{env.EXECUTABLE}}.app" "${{env.APPLICATION}}.app"
ditto -c -k --sequesterRsrc --keepParent "${{env.APPLICATION}}.app" ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
- name: '📤 Upload artifact: ZIP'
uses: actions/upload-artifact@v2
- name: '🪪 Import Code Signing Certificate'
uses: apple-actions/import-codesign-certs@v2
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
p12-file-base64: ${{secrets.CERTIFICATES_P12}}
p12-password: ${{secrets.CERTIFICATES_P12_PASSWORD}}

- name: '✍🏻 Sign Application'
run: codesign --force --deep --options runtime --sign "${{secrets.DEVELOPER_ID}}" "${{env.APPLICATION}}.app"

- name: '💽 Create nice DMG'
run: |
npm install --global create-dmg
rm LICENSE.md
create-dmg "${{env.APPLICATION}}.app" --dmg-title="${{env.APPLICATION}}"
mv "${{env.APPLICATION}} ${{env.VERSION}}.dmg" "${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.dmg"
- name: '📋 Notarize'
uses: alex-spataru/xcode-notarize@v2
with:
product-path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.dmg
appstore-connect-username: ${{secrets.NOTARIZATION_USERNAME}}
appstore-connect-teamid: ${{secrets.NOTARIZATION_TEAMID}}
appstore-connect-password: ${{secrets.NOTARIZATION_PASSWORD}}

- name: '📌 Staple'
uses: BoundfoxStudios/action-xcode-staple@v1
with:
product-path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.dmg

- name: '📤 Upload artifact: DMG'
uses: actions/upload-artifact@v4
with:
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.dmg
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.dmg

#
# Windows build
Expand Down Expand Up @@ -259,7 +296,9 @@ jobs:
name: msys2-pkgs
path: msys2/*.zst

#
# Test Windows MSYS2 packages
#
msys2-test:
if: ${{false}}
needs: msys2-makepkg
Expand Down Expand Up @@ -324,6 +363,6 @@ jobs:
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.zip
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-macOS.dmg
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.exe
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}-Windows.zip
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
.AppleDouble
.LSOverride

# SciTools understand
Serial-Studio.und
# Build & IDEs
*.kdev*
build/*
*.vscode
*.layout

# Icon must end with two \r
Icon
Expand All @@ -31,3 +34,8 @@ Temporary Items

# Qt project file
*.pro.user
*.user

# Clion
.idea/*
cmake-build-*

0 comments on commit 2684aca

Please sign in to comment.