Skip to content

Commit

Permalink
Added clang Linter
Browse files Browse the repository at this point in the history
Test Plan: TBD

Reviewers: jcmcdonald

Reviewed By: jcmcdonald

Tags: #programming_dept, #stormsound_project

Maniphest Tasks: T1319

Revert Plan:
# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
#
# Included commits in branch volume:
#
#         fa1f30c16957 commit
#         ea7f9d9a395c Should be finished
#         e975f2050182 Made a few changes
#         ffa29478e941 Made a few changes
#         6d1ecb2a590b Made changes, would like a review
#         2313a42404e3 Starting to use SDL_Mixer
#         4e928f6d5067 Foundation for StormSound
#         ab04b11335e9 start commit
#
# arc could not identify any existing revision in your working copy.
# If you intended to update an existing revision, use:
#
#   $ arc diff --update <revision>

Differential Revision: https://phab.mousepawmedia.com/D433
  • Loading branch information
Tianlin Fu committed Aug 5, 2021
1 parent cce58a4 commit 9a5722e
Show file tree
Hide file tree
Showing 19 changed files with 816 additions and 20 deletions.
10 changes: 7 additions & 3 deletions .arcconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"phabricator.uri" : "https://phabricator.mousepawmedia.net",
"phabricator.uri" : "https://phab.mousepawmedia.com/",
"repository.callsign" : "ST",
"load" : [
".arclibs/cppcheck"
]
".arclibs/cppcheck/",
".arclibs/clang-format-linter"
],
"phutil_libraries": [
".arclib"
]
}
1 change: 1 addition & 0 deletions .arclibs/clang-format-linter
Submodule clang-format-linter added at 44dfb9
4 changes: 4 additions & 0 deletions .arclint
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"linters": {
"clang-format": {
"type": "clang-format",
"include": "(\\.(hpp|cpp)$)"
},
"cpp": {
"type": "cppcheck",
"include": "(\\.cpp$)"
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".arclibs/clang-format-linter"]
path = .arclibs/clang-format-linter
url = https://github.com/vhbit/clang-format-linter
8 changes: 8 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"includePath": [
"/usr/include/**",
"/usr/local/include/**",
"/usr/local/include/SDL2/**",
"${workspaceRoot}/../libdeps/libs/include/**",
"${workspaceRoot}/../arctic-tern/arctic-tern/include/**",
"${workspaceRoot}/../goldilocks/goldilocks/include/**",
"${workspaceRoot}/../onestring/onestring/include/**",
"${workspaceRoot}/../iosqueak/iosqueak/include/**",
"${workspaceRoot}/../nimbly/nimbly/include/**",
"${workspaceRoot}/**"
Expand All @@ -21,6 +23,7 @@
"${workspaceRoot}/../libdeps/libs/include",
"${workspaceRoot}/../arctic-tern/arctic-tern/include",
"${workspaceRoot}/../goldilocks/goldilocks/include",
"${workspaceRoot}/../onestring/onestring/include",
"${workspaceRoot}/../iosqueak/iosqueak/include",
"${workspaceRoot}/../nimbly/nimbly/include",
"${workspaceRoot}"
Expand All @@ -40,11 +43,13 @@
"name": "Linux",
"includePath": [
"/usr/include/**",
"/usr/include/SDL2/**",
"/usr/local/include/**",
"/usr/lib/gcc/x86_64-linux-gnu/**",
"${workspaceRoot}/../libdeps/libs/include/**",
"${workspaceRoot}/../arctic-tern/arctic-tern/include/**",
"${workspaceRoot}/../goldilocks/goldilocks/include/**",
"${workspaceRoot}/../onestring/onestring/include/**",
"${workspaceRoot}/../iosqueak/iosqueak/include/**",
"${workspaceRoot}/../nimbly/nimbly/include/**",
"${workspaceRoot}/**"
Expand All @@ -59,6 +64,7 @@
"${workspaceRoot}/../libdeps/libs/include",
"${workspaceRoot}/../arctic-tern/arctic-tern/include",
"${workspaceRoot}/../goldilocks/goldilocks/include",
"${workspaceRoot}/../onestring/onestring/include",
"${workspaceRoot}/../iosqueak/iosqueak/include",
"${workspaceRoot}/../nimbly/nimbly/include",
"${workspaceRoot}"
Expand All @@ -77,6 +83,7 @@
"${workspaceRoot}/../libdeps/libs/include/**",
"${workspaceRoot}/../arctic-tern/arctic-tern/include/**",
"${workspaceRoot}/../goldilocks/goldilocks/include/**",
"${workspaceRoot}/../onestring/onestring/include/**",
"${workspaceRoot}/../iosqueak/iosqueak/include/**",
"${workspaceRoot}/../nimbly/nimbly/include/**",
"${workspaceRoot}/**"
Expand All @@ -92,6 +99,7 @@
"${workspaceRoot}/../libdeps/libs/include",
"${workspaceRoot}/../arctic-tern/arctic-tern/include",
"${workspaceRoot}/../goldilocks/goldilocks/include",
"${workspaceRoot}/../onestring/onestring/include",
"${workspaceRoot}/../iosqueak/iosqueak/include",
"${workspaceRoot}/../nimbly/nimbly/include",
"${workspaceRoot}"
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"typeinfo": "cpp",
"exception": "cpp",
"thread": "cpp",
"string_view": "cpp"
"string_view": "cpp",
"mutex": "cpp"
},
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
Expand Down
42 changes: 42 additions & 0 deletions stormsound-source/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"/usr/include/**",
"/usr/include/SDL2/**",
"/usr/local/include/**",
"/usr/lib/gcc/x86_64-linux-gnu/**",
"/home/john/repos/libdeps/libs/include",
"/home/john/repos/arctic-tern/arctic-tern/include",
"/home/john/repos/goldilocks/goldilocks/include",
"/home/john/repos/onestring/onestring/include",
"/home/john/repos/iosqueak/iosqueak/include",
"/home/john/repos/nimbly/nimbly/include",
"${workspaceRoot}/**"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"/usr/include/x86_64-linux-gnu",
"/home/john/repos/libdeps/libs/include",
"/home/john/repos/arctic-tern/arctic-tern/include",
"/home/john/repos/goldilocks/goldilocks/include",
"/home/john/repos/onestring/onestring/include",
"/home/john/repos/iosqueak/iosqueak/include",
"/home/john/repos/nimbly/nimbly/include",
"${workspaceRoot}/**"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 4
}
49 changes: 49 additions & 0 deletions stormsound-source/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
// Controls the font family.
"editor.fontFamily": "Ubuntu Mono",

// Controls the font size.
"editor.fontSize": 15
,"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,

"c-cpp-flylint.cppcheck.force": false,
"c-cpp-flylint.cppcheck.includePaths": [
"./stormsound-source/include"
],
"c-cpp-flylint.standard": [
"c11",
"c++11"
],

"[c]": {
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 4,
},

"[cpp]": {
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 4,
},

"files.associations": {
"array": "cpp",
"cmath": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"exception": "cpp",
"thread": "cpp",
"string_view": "cpp",
"mutex": "cpp"
},
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,

"restructuredtext.builtDocumentationPath": "${workspaceRoot}/docs/build/html",
"C_Cpp.intelliSenseEngineFallback": "Enabled",
"restructuredtext.confPath": "${workspaceFolder}/docs/source",
"cmake.sourceDirectory": "${workspaceFolder}/stormsound-source"

}
6 changes: 6 additions & 0 deletions stormsound-source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ set(INCLUDE_LIBS
# CHANGE: Include files to compile.
set(FILES
include/stormsound/dummy.hpp
include/stormsound/volume.hpp
include/stormsound/StormsoundExceptions.hpp
include/stormsound/stormsound.hpp

src/stormsound.cpp
src/dummy.cpp
src/volume.cpp

)

# CHANGE: Link against dependencies.
Expand Down
45 changes: 45 additions & 0 deletions stormsound-source/include/stormsound/StormsoundExceptions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/** Stormsound Exceptions [Stormsound]
* Version: 0.1
*
* A temporary test class for Stormsound. This will be removed later
* when we have other functionality to build and test with.
*
* Author(s): John Fu, Manuel Mateo
*/

/* LICENSE
* Copyright (C) 2021 MousePaw Media.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef STORMSOUND_EXCEPTIONS_H
#define STORMSOUND_EXCEPTIONS_H
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include <string>

#include "SDL2/SDL.h"

class StormsoundException : public std::exception
{
private:
std::string msg;

public:
StormsoundException(const std::string& msg) : msg(msg){};

virtual const char* what() const noexcept override { return msg.c_str(); }
};
#endif
22 changes: 11 additions & 11 deletions stormsound-source/include/stormsound/dummy.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/** Dummy [Stormsound]
* Version: 0.1
*
* A temporary test class for Stormsound. This will be removed later
* when we have other functionality to build and test with.
*
* Author(s): Jason C. McDonald
*/
* Version: 0.1
*
* A temporary test class for Stormsound. This will be removed later
* when we have other functionality to build and test with.
*
* Author(s): Jason C. McDonald
*/

/* LICENSE
* Copyright (C) 2017 MousePaw Media.
Expand All @@ -28,8 +28,8 @@

class Dummy
{
public:
Dummy(){}
static void speak();
~Dummy(){}
public:
Dummy() {}
static void speak();
~Dummy() {}
};

0 comments on commit 9a5722e

Please sign in to comment.