Skip to content

Commit

Permalink
Fix missing #pragma once and add linter
Browse files Browse the repository at this point in the history
  • Loading branch information
isherman committed Dec 12, 2023
1 parent 0cb6dc3 commit ede517e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,17 @@ repos:
rev: v14.0.0
hooks:
- id: clang-format
- repo: local
hooks:
- id: pragma-once
name: pragma once check
entry: "#pragma once"
language: pygrep
files: \.h$
args: [--negate]
exclude: |
(?x)(
components/pango_core/include/pangolin/utils/picojson.h|
(components/pango_opengl/shaders/.*.glsl.h$)|
components/pango_opengl/src/stb_truetype.h
)
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#include <pangolin/color/colormap.h>
#include <pangolin/drawable/drawn_checker.h>
#include <pangolin/layer/draw_layer.h>
Expand Down
2 changes: 2 additions & 0 deletions components/pango_core/include/pangolin/factory/factory_help.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#include <pangolin/factory/factory_registry.h>

#include <iostream>
Expand Down
2 changes: 2 additions & 0 deletions components/pango_core/include/pangolin/testing/eigen.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#include <catch2/catch_test_macros.hpp>
#include <sophus/common/common.h>

Expand Down
2 changes: 2 additions & 0 deletions components/pango_core/include/pangolin/utils/bitmask.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

// Modified version of https://gpfault.net/posts/typesafe-bitmasks.txt.html
// (public domain)

Expand Down
7 changes: 2 additions & 5 deletions components/pango_core/include/pangolin/utils/parse.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

/* This file is part of the Pangolin Project.
* http://github.com/stevenlovegrove/Pangolin
*
Expand Down Expand Up @@ -25,9 +27,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef PANGOLIN_PARSE_H
#define PANGOLIN_PARSE_H

#include <cctype>
#include <string>

Expand Down Expand Up @@ -108,5 +107,3 @@ inline int ParseToken(
}

} // namespace pangolin

#endif // PANGOLIN_PARSE_H
2 changes: 2 additions & 0 deletions components/pango_vars/include/pangolin/var/varinit.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#include <pangolin/var/varvalue.h>

#include <cstring>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#pragma once

0 comments on commit ede517e

Please sign in to comment.