Repository: cantools/cantools

Issue:
Change source and header format for C source generation to be usable by doxygen without EXTRACT_ALL
Hello everybody,

I have started to integrate cantools into my workflow for developing a project I'm currently working on.
For this project, I only need the C source generator capabilities of this project. The generated source and header files are a great help to keep everything tidy and to reflect any changes made to the database at a later date in my code.

The project I am working on also uses Doxygen to generate its documentation. I have added the generated `.c` and `.h` files to the Doxygen input and realised that they weren't documented unless the `EXTRACT_ALL` setting was activated in the Doxyfile. This is due to the file metadata in the beginning of the file not being present/correctly formatted.

I think it would make more sense to make the file metadata Doxygen-"compliant" in order to integrate its use into a workflow more easily.

If this is a sensible addition from your perspective, I'll happily adopt the template and create a corresponding pull request.

Best regards
Felix Kuhlmann

Hints from issue comments:
@andlaus: I see no harm in changing the output of the code generator in such more or less stylistic ways to accommodate doxygen (I hope I understood your proposal correctly). IOW, as long as your PR does not add a command line option to the code generator, I'll very likely happy to merge it.@felix-khlmnn: Alright, thank you. I will look into it in the next few days and reference this issue in the PR.

Solution patch:
diff --git a/src/cantools/database/can/c_source.py b/src/cantools/database/can/c_source.py
index cf3c40e..17b0a14 100644
--- a/src/cantools/database/can/c_source.py
+++ b/src/cantools/database/can/c_source.py
@@ -23,9 +23,14 @@ THelperKind = tuple[str, int]
 
 HEADER_FMT = '''\
 /**
- * The MIT License (MIT)
+ * @file {file_name}
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @brief This header file was generated by cantools version {version} {date}.
+ *
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -48,10 +53,6 @@ HEADER_FMT = '''\
  * SOFTWARE.
  */
 
-/**
- * This file was generated by cantools version {version} {date}.
- */
-
 #ifndef {include_guard}
 #define {include_guard}
 
@@ -100,9 +101,14 @@ extern "C" {{
 
 SOURCE_FMT = '''\
 /**
- * The MIT License (MIT)
+ * @file {file_name}
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @brief This source file was generated by cantools version {version} {date}.
+ *
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -125,10 +131,6 @@ SOURCE_FMT = '''\
  * SOFTWARE.
  */
 
-/**
- * This file was generated by cantools version {version} {date}.
- */
-
 #include <string.h>
 
 #include "{header}"
@@ -1752,7 +1754,8 @@ def generate(database: "Database",
                                                       node_name)
     helpers = _generate_helpers(helper_kinds)
 
-    header = HEADER_FMT.format(version=__version__,
+    header = HEADER_FMT.format(file_name=header_name,
+                               version=__version__,
                                date=date,
                                include_guard=include_guard,
                                frame_id_defines=frame_id_defines,
@@ -1765,7 +1768,8 @@ def generate(database: "Database",
                                structs=structs,
                                declarations=declarations)
 
-    source = SOURCE_FMT.format(version=__version__,
+    source = SOURCE_FMT.format(file_name=source_name,
+                               version=__version__,
                                date=date,
                                header=header_name,
                                helpers=helpers,


Test patch:
diff --git a/tests/files/c_source/abs.c b/tests/files/c_source/abs.c
index 5c773e3..b35cb99 100644
--- a/tests/files/c_source/abs.c
+++ b/tests/files/c_source/abs.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file abs.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "abs.h"
diff --git a/tests/files/c_source/abs.h b/tests/files/c_source/abs.h
index b156fac..ce287fd 100644
--- a/tests/files/c_source/abs.h
+++ b/tests/files/c_source/abs.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file abs.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef ABS_H
 #define ABS_H
 
diff --git a/tests/files/c_source/camel_case_empty.c b/tests/files/c_source/camel_case_empty.c
index bb3defa..806dbc5 100644
--- a/tests/files/c_source/camel_case_empty.c
+++ b/tests/files/c_source/camel_case_empty.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file camel_case_empty.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "camel_case_empty.h"
diff --git a/tests/files/c_source/camel_case_empty.h b/tests/files/c_source/camel_case_empty.h
index d0c37eb..a603f8b 100644
--- a/tests/files/c_source/camel_case_empty.h
+++ b/tests/files/c_source/camel_case_empty.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file camel_case_empty.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef CAMEL_CASE_EMPTY_H
 #define CAMEL_CASE_EMPTY_H
 
diff --git a/tests/files/c_source/choices.c b/tests/files/c_source/choices.c
index b64b971..21b11f3 100644
--- a/tests/files/c_source/choices.c
+++ b/tests/files/c_source/choices.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file choices.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "choices.h"
diff --git a/tests/files/c_source/choices.h b/tests/files/c_source/choices.h
index ae2e6ae..77dfa6e 100644
--- a/tests/files/c_source/choices.h
+++ b/tests/files/c_source/choices.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file choices.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef CHOICES_H
 #define CHOICES_H
 
diff --git a/tests/files/c_source/floating_point.c b/tests/files/c_source/floating_point.c
index 6760a06..c90eb03 100644
--- a/tests/files/c_source/floating_point.c
+++ b/tests/files/c_source/floating_point.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file floating_point.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "floating_point.h"
diff --git a/tests/files/c_source/floating_point.h b/tests/files/c_source/floating_point.h
index 94b909e..7e342ce 100644
--- a/tests/files/c_source/floating_point.h
+++ b/tests/files/c_source/floating_point.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file floating_point.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef FLOATING_POINT_H
 #define FLOATING_POINT_H
 
diff --git a/tests/files/c_source/floating_point_bit_fields.c b/tests/files/c_source/floating_point_bit_fields.c
index 9366c2d..52d29b0 100644
--- a/tests/files/c_source/floating_point_bit_fields.c
+++ b/tests/files/c_source/floating_point_bit_fields.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file floating_point_bit_fields.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "floating_point_bit_fields.h"
diff --git a/tests/files/c_source/floating_point_bit_fields.h b/tests/files/c_source/floating_point_bit_fields.h
index 82466b7..32f1512 100644
--- a/tests/files/c_source/floating_point_bit_fields.h
+++ b/tests/files/c_source/floating_point_bit_fields.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file floating_point_bit_fields.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef FLOATING_POINT_BIT_FIELDS_H
 #define FLOATING_POINT_BIT_FIELDS_H
 
diff --git a/tests/files/c_source/floating_point_use_float.c b/tests/files/c_source/floating_point_use_float.c
index 81a4a6d..d129fc1 100644
--- a/tests/files/c_source/floating_point_use_float.c
+++ b/tests/files/c_source/floating_point_use_float.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file floating_point_use_float.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "floating_point_use_float.h"
diff --git a/tests/files/c_source/floating_point_use_float.h b/tests/files/c_source/floating_point_use_float.h
index 3b0f501..cd5593f 100644
--- a/tests/files/c_source/floating_point_use_float.h
+++ b/tests/files/c_source/floating_point_use_float.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file floating_point_use_float.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef FLOATING_POINT_USE_FLOAT_H
 #define FLOATING_POINT_USE_FLOAT_H
 
diff --git a/tests/files/c_source/letter_terminated_can_id_6_0.c b/tests/files/c_source/letter_terminated_can_id_6_0.c
index e2b0073..bc09482 100644
--- a/tests/files/c_source/letter_terminated_can_id_6_0.c
+++ b/tests/files/c_source/letter_terminated_can_id_6_0.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file letter_terminated_can_id_6_0.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "letter_terminated_can_id_6_0.h"
diff --git a/tests/files/c_source/letter_terminated_can_id_6_0.h b/tests/files/c_source/letter_terminated_can_id_6_0.h
index 4ab5d98..b1fb1fd 100644
--- a/tests/files/c_source/letter_terminated_can_id_6_0.h
+++ b/tests/files/c_source/letter_terminated_can_id_6_0.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file letter_terminated_can_id_6_0.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef LETTER_TERMINATED_CAN_ID_6_0_H
 #define LETTER_TERMINATED_CAN_ID_6_0_H
 
diff --git a/tests/files/c_source/min_max_only_6_0.c b/tests/files/c_source/min_max_only_6_0.c
index 9d59a33..90b5d8a 100644
--- a/tests/files/c_source/min_max_only_6_0.c
+++ b/tests/files/c_source/min_max_only_6_0.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file min_max_only_6_0.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "min_max_only_6_0.h"
diff --git a/tests/files/c_source/min_max_only_6_0.h b/tests/files/c_source/min_max_only_6_0.h
index 367e004..8397a0f 100644
--- a/tests/files/c_source/min_max_only_6_0.h
+++ b/tests/files/c_source/min_max_only_6_0.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file min_max_only_6_0.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MIN_MAX_ONLY_6_0_H
 #define MIN_MAX_ONLY_6_0_H
 
diff --git a/tests/files/c_source/motohawk.c b/tests/files/c_source/motohawk.c
index 950923b..94bae59 100644
--- a/tests/files/c_source/motohawk.c
+++ b/tests/files/c_source/motohawk.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "motohawk.h"
diff --git a/tests/files/c_source/motohawk.h b/tests/files/c_source/motohawk.h
index d61b07a..ddc6176 100644
--- a/tests/files/c_source/motohawk.h
+++ b/tests/files/c_source/motohawk.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MOTOHAWK_H
 #define MOTOHAWK_H
 
diff --git a/tests/files/c_source/motohawk_bit_fields.c b/tests/files/c_source/motohawk_bit_fields.c
index 03d76db..45adc7e 100644
--- a/tests/files/c_source/motohawk_bit_fields.c
+++ b/tests/files/c_source/motohawk_bit_fields.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk_bit_fields.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "motohawk_bit_fields.h"
diff --git a/tests/files/c_source/motohawk_bit_fields.h b/tests/files/c_source/motohawk_bit_fields.h
index beee0d8..675dd9d 100644
--- a/tests/files/c_source/motohawk_bit_fields.h
+++ b/tests/files/c_source/motohawk_bit_fields.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk_bit_fields.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MOTOHAWK_BIT_FIELDS_H
 #define MOTOHAWK_BIT_FIELDS_H
 
diff --git a/tests/files/c_source/motohawk_no_floating_point_numbers.c b/tests/files/c_source/motohawk_no_floating_point_numbers.c
index 1a53aea..b59614f 100644
--- a/tests/files/c_source/motohawk_no_floating_point_numbers.c
+++ b/tests/files/c_source/motohawk_no_floating_point_numbers.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "motohawk.h"
diff --git a/tests/files/c_source/motohawk_no_floating_point_numbers.h b/tests/files/c_source/motohawk_no_floating_point_numbers.h
index 7f64e60..ad30555 100644
--- a/tests/files/c_source/motohawk_no_floating_point_numbers.h
+++ b/tests/files/c_source/motohawk_no_floating_point_numbers.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MOTOHAWK_H
 #define MOTOHAWK_H
 
diff --git a/tests/files/c_source/motohawk_sender_node.c b/tests/files/c_source/motohawk_sender_node.c
index 508eb4a..9c77272 100644
--- a/tests/files/c_source/motohawk_sender_node.c
+++ b/tests/files/c_source/motohawk_sender_node.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "motohawk.h"
diff --git a/tests/files/c_source/motohawk_sender_node.h b/tests/files/c_source/motohawk_sender_node.h
index 82467ae..9c7aca0 100644
--- a/tests/files/c_source/motohawk_sender_node.h
+++ b/tests/files/c_source/motohawk_sender_node.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MOTOHAWK_H
 #define MOTOHAWK_H
 
diff --git a/tests/files/c_source/motohawk_sender_node_no_floating_point_numbers.c b/tests/files/c_source/motohawk_sender_node_no_floating_point_numbers.c
index 0186f60..5c53d3e 100644
--- a/tests/files/c_source/motohawk_sender_node_no_floating_point_numbers.c
+++ b/tests/files/c_source/motohawk_sender_node_no_floating_point_numbers.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "motohawk.h"
diff --git a/tests/files/c_source/motohawk_sender_node_no_floating_point_numbers.h b/tests/files/c_source/motohawk_sender_node_no_floating_point_numbers.h
index 7f64e60..ad30555 100644
--- a/tests/files/c_source/motohawk_sender_node_no_floating_point_numbers.h
+++ b/tests/files/c_source/motohawk_sender_node_no_floating_point_numbers.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file motohawk.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MOTOHAWK_H
 #define MOTOHAWK_H
 
diff --git a/tests/files/c_source/multiplex.c b/tests/files/c_source/multiplex.c
index 7177a0a..ddcbbfe 100644
--- a/tests/files/c_source/multiplex.c
+++ b/tests/files/c_source/multiplex.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file multiplex.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "multiplex.h"
diff --git a/tests/files/c_source/multiplex.h b/tests/files/c_source/multiplex.h
index a2ad918..7192586 100644
--- a/tests/files/c_source/multiplex.h
+++ b/tests/files/c_source/multiplex.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file multiplex.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MULTIPLEX_H
 #define MULTIPLEX_H
 
diff --git a/tests/files/c_source/multiplex_2.c b/tests/files/c_source/multiplex_2.c
index dc3267b..1188d12 100644
--- a/tests/files/c_source/multiplex_2.c
+++ b/tests/files/c_source/multiplex_2.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file multiplex_2.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "multiplex_2.h"
diff --git a/tests/files/c_source/multiplex_2.h b/tests/files/c_source/multiplex_2.h
index fb36aa3..120cddc 100644
--- a/tests/files/c_source/multiplex_2.h
+++ b/tests/files/c_source/multiplex_2.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file multiplex_2.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MULTIPLEX_2_H
 #define MULTIPLEX_2_H
 
diff --git a/tests/files/c_source/my_database_name.c b/tests/files/c_source/my_database_name.c
index a4559d3..72671af 100644
--- a/tests/files/c_source/my_database_name.c
+++ b/tests/files/c_source/my_database_name.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file my_database_name.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "my_database_name.h"
diff --git a/tests/files/c_source/my_database_name.h b/tests/files/c_source/my_database_name.h
index 7e1bf97..2f8c81d 100644
--- a/tests/files/c_source/my_database_name.h
+++ b/tests/files/c_source/my_database_name.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file my_database_name.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef MY_DATABASE_NAME_H
 #define MY_DATABASE_NAME_H
 
diff --git a/tests/files/c_source/no_signals.c b/tests/files/c_source/no_signals.c
index ad91ab2..c602d3c 100644
--- a/tests/files/c_source/no_signals.c
+++ b/tests/files/c_source/no_signals.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file no_signals.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "no_signals.h"
diff --git a/tests/files/c_source/no_signals.h b/tests/files/c_source/no_signals.h
index 0207258..0f48746 100644
--- a/tests/files/c_source/no_signals.h
+++ b/tests/files/c_source/no_signals.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file no_signals.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef NO_SIGNALS_H
 #define NO_SIGNALS_H
 
diff --git a/tests/files/c_source/open_actuator.c b/tests/files/c_source/open_actuator.c
index 3917a0e..70099a6 100644
--- a/tests/files/c_source/open_actuator.c
+++ b/tests/files/c_source/open_actuator.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file open_actuator.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "open_actuator.h"
diff --git a/tests/files/c_source/open_actuator.h b/tests/files/c_source/open_actuator.h
index 8c5220b..21a4c4b 100644
--- a/tests/files/c_source/open_actuator.h
+++ b/tests/files/c_source/open_actuator.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file open_actuator.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef OPEN_ACTUATOR_H
 #define OPEN_ACTUATOR_H
 
diff --git a/tests/files/c_source/open_actuator_no_floating_point_numbers.c b/tests/files/c_source/open_actuator_no_floating_point_numbers.c
index 964e51f..05b41c4 100644
--- a/tests/files/c_source/open_actuator_no_floating_point_numbers.c
+++ b/tests/files/c_source/open_actuator_no_floating_point_numbers.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file open_actuator.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "open_actuator.h"
diff --git a/tests/files/c_source/open_actuator_no_floating_point_numbers.h b/tests/files/c_source/open_actuator_no_floating_point_numbers.h
index ef4c2ce..cd1de2e 100644
--- a/tests/files/c_source/open_actuator_no_floating_point_numbers.h
+++ b/tests/files/c_source/open_actuator_no_floating_point_numbers.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file open_actuator.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef OPEN_ACTUATOR_H
 #define OPEN_ACTUATOR_H
 
diff --git a/tests/files/c_source/open_actuator_sender_node.c b/tests/files/c_source/open_actuator_sender_node.c
index 3d4e324..67ab375 100644
--- a/tests/files/c_source/open_actuator_sender_node.c
+++ b/tests/files/c_source/open_actuator_sender_node.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file open_actuator.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "open_actuator.h"
diff --git a/tests/files/c_source/open_actuator_sender_node.h b/tests/files/c_source/open_actuator_sender_node.h
index 4275e60..3a97879 100644
--- a/tests/files/c_source/open_actuator_sender_node.h
+++ b/tests/files/c_source/open_actuator_sender_node.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file open_actuator.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef OPEN_ACTUATOR_H
 #define OPEN_ACTUATOR_H
 
diff --git a/tests/files/c_source/open_actuator_sender_node_no_floating_point_numbers.c b/tests/files/c_source/open_actuator_sender_node_no_floating_point_numbers.c
index ba043df..68f1149 100644
--- a/tests/files/c_source/open_actuator_sender_node_no_floating_point_numbers.c
+++ b/tests/files/c_source/open_actuator_sender_node_no_floating_point_numbers.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file open_actuator.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "open_actuator.h"
diff --git a/tests/files/c_source/open_actuator_sender_node_no_floating_point_numbers.h b/tests/files/c_source/open_actuator_sender_node_no_floating_point_numbers.h
index 177ce0d..aadebde 100644
--- a/tests/files/c_source/open_actuator_sender_node_no_floating_point_numbers.h
+++ b/tests/files/c_source/open_actuator_sender_node_no_floating_point_numbers.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file open_actuator.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef OPEN_ACTUATOR_H
 #define OPEN_ACTUATOR_H
 
diff --git a/tests/files/c_source/padding_bit_order.c b/tests/files/c_source/padding_bit_order.c
index cd0505b..5ce4c76 100644
--- a/tests/files/c_source/padding_bit_order.c
+++ b/tests/files/c_source/padding_bit_order.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file padding_bit_order.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "padding_bit_order.h"
diff --git a/tests/files/c_source/padding_bit_order.h b/tests/files/c_source/padding_bit_order.h
index 6c9a6d1..76855ca 100644
--- a/tests/files/c_source/padding_bit_order.h
+++ b/tests/files/c_source/padding_bit_order.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file padding_bit_order.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef PADDING_BIT_ORDER_H
 #define PADDING_BIT_ORDER_H
 
diff --git a/tests/files/c_source/signed.c b/tests/files/c_source/signed.c
index 363123c..f73ff18 100644
--- a/tests/files/c_source/signed.c
+++ b/tests/files/c_source/signed.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file signed.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "signed.h"
diff --git a/tests/files/c_source/signed.h b/tests/files/c_source/signed.h
index e3b8841..9c0d6dd 100644
--- a/tests/files/c_source/signed.h
+++ b/tests/files/c_source/signed.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file signed.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef SIGNED_H
 #define SIGNED_H
 
diff --git a/tests/files/c_source/signed_bit_fields.c b/tests/files/c_source/signed_bit_fields.c
index 80772f6..b3ad21a 100644
--- a/tests/files/c_source/signed_bit_fields.c
+++ b/tests/files/c_source/signed_bit_fields.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file signed_bit_fields.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "signed_bit_fields.h"
diff --git a/tests/files/c_source/signed_bit_fields.h b/tests/files/c_source/signed_bit_fields.h
index a6ca430..f44c63b 100644
--- a/tests/files/c_source/signed_bit_fields.h
+++ b/tests/files/c_source/signed_bit_fields.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file signed_bit_fields.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef SIGNED_BIT_FIELDS_H
 #define SIGNED_BIT_FIELDS_H
 
diff --git a/tests/files/c_source/vehicle.c b/tests/files/c_source/vehicle.c
index ec02035..37c75a4 100644
--- a/tests/files/c_source/vehicle.c
+++ b/tests/files/c_source/vehicle.c
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file vehicle.c
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #include <string.h>
 
 #include "vehicle.h"
diff --git a/tests/files/c_source/vehicle.h b/tests/files/c_source/vehicle.h
index 9af216a..b831e26 100644
--- a/tests/files/c_source/vehicle.h
+++ b/tests/files/c_source/vehicle.h
@@ -1,7 +1,12 @@
 /**
- * The MIT License (MIT)
+ * @file vehicle.h
+ *
+
  *
- * Copyright (c) 2018-2019 Erik Moqvist
+ * @copyright Copyright (c) 2018-2019 Erik Moqvist
+ *
+ * @par License
+ * The MIT License (MIT)
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -24,10 +29,6 @@
  * SOFTWARE.
  */
 
-/**
-
- */
-
 #ifndef VEHICLE_H
 #define VEHICLE_H
 
diff --git a/tests/test_command_line.py b/tests/test_command_line.py
index d185e01..0bf1d6a 100644
--- a/tests/test_command_line.py
+++ b/tests/test_command_line.py
@@ -48,7 +48,7 @@ def with_fake_screen_width(screen_width):
 
 
 def remove_date_time(string):
-    return re.sub(r'.* This file was generated.*', '', string)
+    return re.sub(r'.*This.* file was generated.*', '', string)
 
 
 def read_file(filename):