Skip to content

Commit

Permalink
Configure include cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanoBilenchi committed Jun 4, 2024
1 parent 5935c8f commit 9faf65a
Show file tree
Hide file tree
Showing 106 changed files with 443 additions and 157 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ Checks: >
clang-analyzer-*,
-clang-analyzer-cplusplus-*,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
misc-header-include-cycle,
misc-include-cleaner,
performance-*,
portability-*
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Configure CMake
run: >
CC=clang cmake -B ${{env.build_dir}}
-DULIB_CLANG_TIDY=ON
-DCOWL_CLANG_TIDY=ON
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
- name: Build
run: cmake --build ${{env.build_dir}}
Expand Down
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ set(COWL_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(COWL_PUBLIC_HEADERS_DIR "${COWL_PROJECT_DIR}/include")
set(COWL_LIB_DIR "${COWL_PROJECT_DIR}/lib")
set(COWL_SRC_DIR "${COWL_PROJECT_DIR}/src")
set(COWL_PRIVATE_HEADERS_DIR "${COWL_SRC_DIR}/include")
set(COWL_READER_DIR "${COWL_SRC_DIR}/reader")
set(COWL_WRITER_DIR "${COWL_SRC_DIR}/writer")

Expand Down Expand Up @@ -97,10 +96,7 @@ endif()
# Header dirs

set(COWL_PUBLIC_HEADERS_DIRS "${COWL_PUBLIC_HEADERS_DIR}")

set(COWL_PRIVATE_HEADERS_DIRS
"${COWL_PRIVATE_HEADERS_DIR}"
"${COWL_SRC_DIR}")
set(COWL_PRIVATE_HEADERS_DIRS "${COWL_SRC_DIR}")

# Header files

Expand Down
3 changes: 3 additions & 0 deletions examples/00_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* @copyright SPDX-License-Identifier: EPL-2.0
*/
#include "cowl.h"
#include "ulib.h"
#include <stdio.h>
#include <stdlib.h>

#define ONTO "example_pizza.owl"

Expand Down
3 changes: 3 additions & 0 deletions examples/01_errors_imports.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* @copyright SPDX-License-Identifier: EPL-2.0
*/
#include "cowl.h"
#include "ulib.h"
#include <stdio.h>
#include <stdlib.h>

#define ONTO "example_pizza.owl"
#define IMPORT "import.owl"
Expand Down
3 changes: 3 additions & 0 deletions examples/02_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
* @copyright SPDX-License-Identifier: EPL-2.0
*/
#include "cowl.h"
#include "ulib.h"
#include <stdio.h>
#include <stdlib.h>

#define ONTO "example_pizza.owl"
#define NS "http://www.co-ode.org/ontologies/pizza/pizza.owl#"
Expand Down
3 changes: 3 additions & 0 deletions examples/03_recursive_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
* @copyright SPDX-License-Identifier: EPL-2.0
*/
#include "cowl.h"
#include "ulib.h"
#include <stdio.h>
#include <stdlib.h>

#define ONTO "example_pizza.owl"
#define NS "http://www.co-ode.org/ontologies/pizza/pizza.owl#"
Expand Down
3 changes: 3 additions & 0 deletions examples/04_editing.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
* @copyright SPDX-License-Identifier: EPL-2.0
*/
#include "cowl.h"
#include "ulib.h"
#include <stdio.h>
#include <stdlib.h>

#define IN_PATH "example_pizza.owl"
#define OUT_PATH "example_pizza_new.owl"
Expand Down
3 changes: 3 additions & 0 deletions examples/05_istream.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* @copyright SPDX-License-Identifier: EPL-2.0
*/
#include "cowl.h"
#include "ulib.h"
#include <stdio.h>
#include <stdlib.h>

#define ONTO "example_pizza.owl"
#define NS "http://www.co-ode.org/ontologies/pizza/pizza.owl#"
Expand Down
3 changes: 3 additions & 0 deletions examples/06_ostream.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
*/

#include "cowl.h"
#include "ulib.h"
#include <stdio.h>
#include <stdlib.h>

#define PATH "porcini_pizza.owl"

Expand Down
6 changes: 5 additions & 1 deletion include/cowl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#ifndef COWL_H
#define COWL_H

// IWYU pragma: begin_exports

#include "cowl_annot_assert_axiom.h"
#include "cowl_annot_prop.h"
#include "cowl_annot_prop_domain_axiom.h"
Expand Down Expand Up @@ -99,13 +101,13 @@
#include "cowl_owl_vocab.h"
#include "cowl_position.h"
#include "cowl_primitive.h"
#include "cowl_primitive_flags.h"
#include "cowl_primitive_type.h"
#include "cowl_quant_type.h"
#include "cowl_rdf_vocab.h"
#include "cowl_rdfs_vocab.h"
#include "cowl_reader.h"
#include "cowl_ret.h"
#include "cowl_std.h"
#include "cowl_string.h"
#include "cowl_string_opts.h"
#include "cowl_sub_annot_prop_axiom.h"
Expand All @@ -120,4 +122,6 @@
#include "cowl_writer.h"
#include "cowl_xsd_vocab.h"

// IWYU pragma: end_exports

#endif // COWL_H
1 change: 1 addition & 0 deletions include/cowl_axiom_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define COWL_AXIOM_FILTER_H

#include "cowl_axiom_flags.h"
#include "cowl_ret.h"
#include "cowl_vector.h"

COWL_BEGIN_DECLS
Expand Down
1 change: 0 additions & 1 deletion include/cowl_axiom_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define COWL_AXIOM_FLAGS_H

#include "cowl_axiom_type.h"
#include "cowl_std.h"

COWL_BEGIN_DECLS

Expand Down
1 change: 0 additions & 1 deletion include/cowl_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "cowl_error_handler.h"
#include "cowl_import_loader.h"
#include "cowl_reader.h"
#include "cowl_std.h"
#include "cowl_writer.h"

COWL_BEGIN_DECLS
Expand Down
5 changes: 4 additions & 1 deletion include/cowl_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
#ifndef COWL_ERROR_H
#define COWL_ERROR_H

#include "cowl_std.h"
#include "cowl_any.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"
#include "cowl_ret.h"

COWL_BEGIN_DECLS

Expand Down
1 change: 0 additions & 1 deletion include/cowl_import_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define COWL_IMPORT_LOADER_H

#include "cowl_error.h"
#include "cowl_std.h"

COWL_BEGIN_DECLS

Expand Down
5 changes: 4 additions & 1 deletion include/cowl_istream_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
#ifndef COWL_ISTREAM_HANDLERS_H
#define COWL_ISTREAM_HANDLERS_H

#include "cowl_std.h"
#include "cowl_any.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"
#include "cowl_ret.h"

COWL_BEGIN_DECLS

Expand Down
2 changes: 1 addition & 1 deletion include/cowl_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#ifndef COWL_ITERATOR_H
#define COWL_ITERATOR_H

#include "cowl_any.h"
#include "cowl_primitive_flags.h"
#include "cowl_std.h"

COWL_BEGIN_DECLS

Expand Down
1 change: 0 additions & 1 deletion include/cowl_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define COWL_OBJECT_H

#include "cowl_impl.h"
#include "cowl_std.h"

COWL_BEGIN_DECLS

Expand Down
2 changes: 1 addition & 1 deletion include/cowl_ontology.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "cowl_object.h"
#include "cowl_ontology_id.h"
#include "cowl_position.h"
#include "cowl_std.h"
#include "cowl_ret.h"

COWL_BEGIN_DECLS

Expand Down
3 changes: 2 additions & 1 deletion include/cowl_ontology_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#ifndef COWL_ONTOLOGY_ID_H
#define COWL_ONTOLOGY_ID_H

#include "cowl_std.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"

COWL_BEGIN_DECLS

Expand Down
6 changes: 5 additions & 1 deletion include/cowl_ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
#ifndef COWL_OSTREAM_H
#define COWL_OSTREAM_H

#include "cowl_std.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"
#include "cowl_ontology_header.h"
#include "cowl_ret.h"

COWL_BEGIN_DECLS

/// @cond
cowl_struct_decl(CowlManager);
cowl_struct_decl(CowlOntology);
cowl_struct_decl(CowlSymTable);
/// @endcond

Expand Down
3 changes: 2 additions & 1 deletion include/cowl_owl_vocab.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#ifndef COWL_OWL_VOCAB_H
#define COWL_OWL_VOCAB_H

#include "cowl_std.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"

COWL_BEGIN_DECLS

Expand Down
2 changes: 1 addition & 1 deletion include/cowl_position.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef COWL_POSITION_H
#define COWL_POSITION_H

#include "cowl_std.h"
#include "cowl_attrs.h"

COWL_BEGIN_DECLS

Expand Down
1 change: 0 additions & 1 deletion include/cowl_primitive_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define COWL_PRIMITIVE_FLAGS_H

#include "cowl_primitive_type.h"
#include "cowl_std.h"

COWL_BEGIN_DECLS

Expand Down
3 changes: 2 additions & 1 deletion include/cowl_rdf_vocab.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#ifndef COWL_RDF_VOCAB_H
#define COWL_RDF_VOCAB_H

#include "cowl_std.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"

COWL_BEGIN_DECLS

Expand Down
3 changes: 2 additions & 1 deletion include/cowl_rdfs_vocab.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#ifndef COWL_RDFS_VOCAB_H
#define COWL_RDFS_VOCAB_H

#include "cowl_std.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"

COWL_BEGIN_DECLS

Expand Down
4 changes: 3 additions & 1 deletion include/cowl_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#ifndef COWL_READER_H
#define COWL_READER_H

#include "cowl_std.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"
#include "cowl_ret.h"

COWL_BEGIN_DECLS

Expand Down
27 changes: 0 additions & 27 deletions include/cowl_std.h

This file was deleted.

3 changes: 2 additions & 1 deletion include/cowl_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#define COWL_STRING_H

#include "cowl_object.h"
#include "cowl_string_opts.h"
#include "cowl_ret.h"
#include "cowl_string_opts.h" // IWYU pragma: export

COWL_BEGIN_DECLS

Expand Down
2 changes: 1 addition & 1 deletion include/cowl_string_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef COWL_STRING_OPTS_H
#define COWL_STRING_OPTS_H

#include "cowl_std.h"
#include "cowl_attrs.h"

COWL_BEGIN_DECLS

Expand Down
4 changes: 3 additions & 1 deletion include/cowl_sym_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#ifndef COWL_SYM_TABLE_H
#define COWL_SYM_TABLE_H

#include "cowl_std.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"
#include "cowl_ret.h"

COWL_BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions include/cowl_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#ifndef COWL_VECTOR_H
#define COWL_VECTOR_H

#include "cowl_any.h"
#include "cowl_object.h"

COWL_BEGIN_DECLS
Expand Down
7 changes: 6 additions & 1 deletion include/cowl_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
#ifndef COWL_VERSION_H
#define COWL_VERSION_H

#include "cowl_std.h"
#include "cowl_attrs.h"
#include "cowl_macros.h"

COWL_BEGIN_DECLS

/// @cond
cowl_struct_decl(CowlString);
/// @endcond

/**
* @defgroup version Library version metadata
* @{
Expand Down
Loading

0 comments on commit 9faf65a

Please sign in to comment.