diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ba3f81e434b808caac7e8e5df6cc7ad950baa71d..5148ca33c15932abaa2d9824763cef26499ff17d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,6 +10,7 @@ variables:
 # normal multi-step pipeline for each commit
 stages:
   - config
+  - quality
   - build_test
   - optional
 
@@ -51,6 +52,24 @@ config-clang-8:
        - build
        - corsika-data
 
+check-copyrights:
+  image: corsika/devel:u-18.04
+  stage: quality
+  tags:
+    - corsika
+  script:
+    - ./do-copyright.py
+
+check-clang-format:
+  image: corsika/devel:u-18.04
+  before_script:
+  - apt-get update && apt-get install -y -qq clang-format
+  stage: quality
+  tags:
+    - corsika
+  script:
+    - ./do-clang-format.py --all
+
 # normal pipeline for each commit
 build-test-u-18_04: 
   image: corsika/devel:u-18.04
diff --git a/Documentation/Examples/cascade_example.cc b/Documentation/Examples/cascade_example.cc
index c219b3d49fe2afb893c2ef7a095e79c5dde92dc8..f5c09343babcf62f87135a2fadb124c74a144f7e 100644
--- a/Documentation/Examples/cascade_example.cc
+++ b/Documentation/Examples/cascade_example.cc
@@ -124,7 +124,7 @@ int main() {
     cout << "input momentum: " << plab.GetComponents() / 1_GeV << endl;
     stack.AddParticle(std::tuple<particles::Code, units::si::HEPEnergyType,
                                  corsika::stack::MomentumVector, geometry::Point,
-		      units::si::TimeType, unsigned short, unsigned short>{
+                                 units::si::TimeType, unsigned short, unsigned short>{
         beamCode, E0, plab, injectionPos, 0_ns, nuclA, nuclZ});
   }
 
diff --git a/Documentation/Examples/particle_list_example.cc b/Documentation/Examples/particle_list_example.cc
index 659b0d0e0ae50a35bda1411efb33f3ea2b0ad130..c83465f20014a242e9123e85c6b2f4e61ea7fc72 100644
--- a/Documentation/Examples/particle_list_example.cc
+++ b/Documentation/Examples/particle_list_example.cc
@@ -46,20 +46,18 @@ int main() {
           (sib_id != corsika::process::sibyll::SibyllCode::Unknown
                ? to_string(corsika::process::sibyll::GetSibyllMass(p) / 1_GeV)
                : "--");
-      auto const qgs_id =
-          corsika::process::qgsjetII::ConvertToQgsjetII(p);
+      auto const qgs_id = corsika::process::qgsjetII::ConvertToQgsjetII(p);
       cout << std::setw(20) << std::setfill(' ') << p << " | " << std::setw(10)
            << static_cast<int>(GetPDG(p)) << " | " << std::setw(10)
            << (sib_id != corsika::process::sibyll::SibyllCode::Unknown
                    ? to_string(static_cast<int>(sib_id))
                    : "--")
            << " | " << std::setw(10)
-	   << (qgs_id != corsika::process::qgsjetII::QgsjetIICode::Unknown
+           << (qgs_id != corsika::process::qgsjetII::QgsjetIICode::Unknown
                    ? to_string(static_cast<int>(qgs_id))
                    : "--")
-	   << " | "
-           << std::setw(18) << std::setprecision(5) << GetMass(p) / 1_GeV << " | "
-           << std::setw(18) << std::setprecision(5) << sib_mass << " | " << endl;
+           << " | " << std::setw(18) << std::setprecision(5) << GetMass(p) / 1_GeV
+           << " | " << std::setw(18) << std::setprecision(5) << sib_mass << " | " << endl;
     }
   }
   cout << std::setw(104) << std::setfill('-') << "-" << endl;
diff --git a/Environment/LayeredSphericalAtmosphereBuilder.cc b/Environment/LayeredSphericalAtmosphereBuilder.cc
index 4d1631d54e42431cd1b36299af9083c643bce0e7..2366266e278606a684f935acf89f33ee73d49252 100644
--- a/Environment/LayeredSphericalAtmosphereBuilder.cc
+++ b/Environment/LayeredSphericalAtmosphereBuilder.cc
@@ -8,9 +8,9 @@
  * the license.
  */
 
-#include <corsika/environment/LayeredSphericalAtmosphereBuilder.h>
 #include <corsika/environment/FlatExponential.h>
 #include <corsika/environment/HomogeneousMedium.h>
+#include <corsika/environment/LayeredSphericalAtmosphereBuilder.h>
 #include <corsika/environment/SlidingPlanarExponential.h>
 
 using namespace corsika::environment;
diff --git a/Environment/testEnvironment.cc b/Environment/testEnvironment.cc
index 5c314d1d07b5b9a5faad15ea2345114a5fb8f3f1..574907e5914ec7e97628023483f4dd7572dde836 100644
--- a/Environment/testEnvironment.cc
+++ b/Environment/testEnvironment.cc
@@ -8,12 +8,12 @@
  * the license.
  */
 
-#include <corsika/environment/LayeredSphericalAtmosphereBuilder.h>
 #include <corsika/environment/DensityFunction.h>
 #include <corsika/environment/FlatExponential.h>
 #include <corsika/environment/HomogeneousMedium.h>
 #include <corsika/environment/IMediumModel.h>
 #include <corsika/environment/InhomogeneousMedium.h>
+#include <corsika/environment/LayeredSphericalAtmosphereBuilder.h>
 #include <corsika/environment/LinearApproximationIntegrator.h>
 #include <corsika/environment/NuclearComposition.h>
 #include <corsika/environment/SlidingPlanarExponential.h>
diff --git a/Processes/QGSJetII/QGSJetIIStack.h b/Processes/QGSJetII/QGSJetIIStack.h
index 70288ef4e3c0ee1ffeea5978b0e11e77c70fdc57..a58f3fe97fa6405530acc6eb9a61023fac2b551f 100644
--- a/Processes/QGSJetII/QGSJetIIStack.h
+++ b/Processes/QGSJetII/QGSJetIIStack.h
@@ -55,11 +55,12 @@ namespace corsika::process::qgsjetII {
       using namespace corsika::units::si;
       return qgarr14_.esp[i][0] * 1_GeV;
     }
-    MomentumVector GetMomentum(const unsigned int i, const corsika::geometry::CoordinateSystem& CS) const {
+    MomentumVector GetMomentum(const unsigned int i,
+                               const corsika::geometry::CoordinateSystem& CS) const {
       using namespace corsika::units::si;
       geometry::QuantityVector<hepmomentum_d> components = {qgarr14_.esp[i][2] * 1_GeV,
-                                                  qgarr14_.esp[i][3] * 1_GeV,
-                                                  qgarr14_.esp[i][1] * 1_GeV};
+                                                            qgarr14_.esp[i][3] * 1_GeV,
+                                                            qgarr14_.esp[i][1] * 1_GeV};
       return MomentumVector(CS, components);
     }
 
@@ -87,8 +88,7 @@ namespace corsika::process::qgsjetII {
     using corsika::stack::ParticleBase<StackIteratorInterface>::GetIndex;
 
   public:
-    void SetParticleData(const int vID, 
-                         const corsika::units::si::HEPEnergyType vE,
+    void SetParticleData(const int vID, const corsika::units::si::HEPEnergyType vE,
                          const MomentumVector& vP,
                          const corsika::units::si::HEPMassType vM) {
       SetPID(vID);
@@ -97,8 +97,7 @@ namespace corsika::process::qgsjetII {
     }
 
     void SetParticleData(ParticleInterface<StackIteratorInterface>& /*parent*/,
-                         const int vID, 
-                         const corsika::units::si::HEPEnergyType vE,
+                         const int vID, const corsika::units::si::HEPEnergyType vE,
                          const MomentumVector& vP,
                          const corsika::units::si::HEPMassType vM) {
       SetPID(vID);
@@ -121,7 +120,9 @@ namespace corsika::process::qgsjetII {
           GetStackData().GetId(GetIndex()));
     }
 
-    MomentumVector GetMomentum(const corsika::geometry::CoordinateSystem& CS) const { return GetStackData().GetMomentum(GetIndex(), CS); }
+    MomentumVector GetMomentum(const corsika::geometry::CoordinateSystem& CS) const {
+      return GetStackData().GetMomentum(GetIndex(), CS);
+    }
 
     void SetMomentum(const MomentumVector& v) {
       GetStackData().SetMomentum(GetIndex(), v);
diff --git a/Processes/Sibyll/ParticleConversion.h b/Processes/Sibyll/ParticleConversion.h
index 3604a5a23b40ac2ea3775c40307f9d2b413d6fc6..63b06f19d226cd242aeb455520e9c986cd363721 100644
--- a/Processes/Sibyll/ParticleConversion.h
+++ b/Processes/Sibyll/ParticleConversion.h
@@ -33,12 +33,10 @@ namespace corsika::process::sibyll {
   };
   using SibyllXSClassIntType = std::underlying_type<SibyllXSClass>::type;
 
-  
 #include <corsika/process/sibyll/Generated.inc>
 
   SibyllCode constexpr ConvertToSibyll(corsika::particles::Code pCode) {
-    return 
-        corsika2sibyll[static_cast<corsika::particles::CodeIntType>(pCode)];
+    return corsika2sibyll[static_cast<corsika::particles::CodeIntType>(pCode)];
   }
 
   corsika::particles::Code constexpr ConvertFromSibyll(SibyllCode pCode) {
@@ -57,7 +55,8 @@ namespace corsika::process::sibyll {
   }
 
   int constexpr GetSibyllXSCode(corsika::particles::Code pCode) {
-    return static_cast<SibyllXSClassIntType>(corsika2sibyllXStype[static_cast<corsika::particles::CodeIntType>(pCode)]);
+    return static_cast<SibyllXSClassIntType>(
+        corsika2sibyllXStype[static_cast<corsika::particles::CodeIntType>(pCode)]);
   }
 
   bool constexpr CanInteract(corsika::particles::Code pCode) {