Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md to include cpp linter badge #29

Merged
merged 5 commits into from
Jul 25, 2024

Conversation

ewanwm
Copy link
Owner

@ewanwm ewanwm commented Jul 24, 2024

(and also serves as a dummy PR to test that linting actually works for pull requests)

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format reports: 17 file(s) not formatted
  • tests/barger-propagator.hpp
  • tests/test-utils.hpp
  • nuTens/logging.hpp
  • nuTens/nuTens-pch.hpp
  • nuTens/tensors/dtypes.hpp
  • nuTens/tensors/tensor.hpp
  • nuTens/propagator/constants.hpp
  • nuTens/propagator/base-matter-solver.hpp
  • nuTens/propagator/propagator.hpp
  • nuTens/propagator/const-density-solver.hpp
  • tests/two-flavour-const-matter.cpp
  • tests/barger.cpp
  • tests/tensor-basic.cpp
  • tests/two-flavour-vacuum.cpp
  • nuTens/tensors/torch-tensor.cpp
  • nuTens/propagator/propagator.cpp
  • nuTens/propagator/const-density-solver.cpp
clang-tidy reports: 145 concern(s)
  • tests/barger-propagator.hpp:3:10: error: [clang-diagnostic-error]

    'nuTens/propagator/constants.hpp' file not found

    #include <nuTens/propagator/constants.hpp>
             ^
  • tests/barger-propagator.hpp:4:10: warning: [modernize-deprecated-headers]

    inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead

    #include <math.h>
             ^~~~~~~~
             <cmath>
  • tests/barger-propagator.hpp:35:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            inline float lv( float energy ) { return 4.0 * M_PI * energy / (_m1*_m1 - _m2*_m2); }
                   ~~~~~ ^
                   auto                     -> float
  • tests/barger-propagator.hpp:35:22: warning: [readability-make-member-function-const]

    method 'lv' can be made const

            inline float lv( float energy ) { return 4.0 * M_PI * energy / (_m1*_m1 - _m2*_m2); }
                         ^
                                            const
  • tests/barger-propagator.hpp:38:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            inline float lm() { return 2.0 * M_PI / (Constants::Groot2 * _density); }
                   ~~~~~ ^
                   auto       -> float
  • tests/barger-propagator.hpp:41:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            inline float calculateEffectiveAngle( float energy ){
                   ~~~~~ ^
                   auto                                          -> float
  • tests/barger-propagator.hpp:42:32: warning: [readability-braces-around-statements]

    statement should be inside braces

                if (_density > 0.0)
                                   ^
                                    {
  • tests/barger-propagator.hpp:44:13: warning: [readability-else-after-return]

    do not use 'else' after 'return'

                else
                ^~~~
                                return _theta
  • tests/barger-propagator.hpp:44:17: warning: [readability-braces-around-statements]

    statement should be inside braces

                else
                    ^
    note: this fix will not be applied because it overlaps with another fix
  • tests/barger-propagator.hpp:49:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            inline float calculateEffectiveDm2( float energy ){
                   ~~~~~ ^
                   auto                                        -> float
  • tests/barger-propagator.hpp:50:32: warning: [readability-braces-around-statements]

    statement should be inside braces

                if (_density > 0.0)
                                   ^
                                    {
  • tests/barger-propagator.hpp:52:13: warning: [readability-else-after-return]

    do not use 'else' after 'return'

                else
                ^~~~
                                return (_m1*_m1 - _m2*_m2)
  • tests/barger-propagator.hpp:52:17: warning: [readability-braces-around-statements]

    statement should be inside braces

                else
                    ^
    note: this fix will not be applied because it overlaps with another fix
  • tests/barger-propagator.hpp:58:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            inline float getPMNSelement(float energy, int alpha, int beta){
                   ~~~~~ ^
                   auto                                                    -> float
  • tests/barger-propagator.hpp:67:43: warning: [readability-braces-around-statements]

    statement should be inside braces

                if ( alpha == 0 && beta == 0 )
                                              ^
                                               {
  • tests/barger-propagator.hpp:68:17: warning: [bugprone-branch-clone]

    repeated branch in conditional chain

                    return std::cos(gamma);
                    ^
    /home/runner/work/nuTens/nuTens/tests/barger-propagator.hpp:68:39: note: end of the original
                    return std::cos(gamma);
                                          ^
    /home/runner/work/nuTens/nuTens/tests/barger-propagator.hpp:70:17: note: clone 1 starts here
                    return std::cos(gamma);
                    ^
  • tests/barger-propagator.hpp:69:13: warning: [readability-else-after-return]

    do not use 'else' after 'return'

                else if (alpha == 1 && beta == 1)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • tests/barger-propagator.hpp:69:46: warning: [readability-braces-around-statements]

    statement should be inside braces

                else if (alpha == 1 && beta == 1)
                                                 ^
    note: this fix will not be applied because it overlaps with another fix
  • tests/barger-propagator.hpp:71:46: warning: [readability-braces-around-statements]

    statement should be inside braces

                else if (alpha == 0 && beta == 1) 
                                                 ^
    note: this fix will not be applied because it overlaps with another fix
  • tests/barger-propagator.hpp:73:46: warning: [readability-braces-around-statements]

    statement should be inside braces

                else if (alpha == 1 && beta == 0)
                                                 ^
    note: this fix will not be applied because it overlaps with another fix
  • tests/barger-propagator.hpp:84:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            inline float calculateProb(float energy, int alpha, int beta){
                   ~~~~~ ^
                   auto                                                   -> float
  • tests/barger-propagator.hpp:104:33: warning: [readability-braces-around-statements]

    statement should be inside braces

                if ( alpha == beta ) 
                                    ^
                                     {
  • tests/barger-propagator.hpp:106:13: warning: [readability-else-after-return]

    do not use 'else' after 'return'

                else 
                ^~~~~
  • tests/barger-propagator.hpp:106:17: warning: [readability-braces-around-statements]

    statement should be inside braces

                else 
                    ^
    note: this fix will not be applied because it overlaps with another fix
  • tests/test-utils.hpp:3:10: warning: [modernize-deprecated-headers]

    inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead

    #include <math.h>
             ^~~~~~~~
             <cmath>
  • tests/test-utils.hpp:12:11: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        float relativeDiff(float f1, float f2){
        ~~~~~ ^
        auto                                   -> float
  • tests/test-utils.hpp:25:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'TEST_EXPECTED' used; consider a 'constexpr' template function

    #define TEST_EXPECTED(value, expectation, varName, threshold) { \
            ^
  • tests/test-utils.hpp:26:52: warning: [bugprone-macro-parentheses]

    macro argument should be enclosed in parentheses

        if(Testing::relativeDiff(value, expectation) > threshold){  \
                                                       ^
                                                       (        )
  • tests/test-utils.hpp:27:32: warning: [bugprone-macro-parentheses]

    macro argument should be enclosed in parentheses

            std::cerr << "bad " << varName << std::endl;            \
                                   ^
                                   (      )
  • tests/test-utils.hpp:28:33: warning: [bugprone-macro-parentheses]

    macro argument should be enclosed in parentheses

            std::cerr << "Got: " << value;                          \
                                    ^
                                    (    )
  • tests/test-utils.hpp:29:40: warning: [bugprone-macro-parentheses]

    macro argument should be enclosed in parentheses

            std::cerr << "; Expected: " << expectation;             \
                                           ^
                                           (          )
  • nuTens/logging.hpp:11:9: warning: [cppcoreguidelines-macro-usage]

    macro 'NT_LOG_LEVEL_TRACE' used to declare a constant; consider using a 'constexpr' constant

    #define NT_LOG_LEVEL_TRACE 0
            ^
  • nuTens/logging.hpp:12:9: warning: [cppcoreguidelines-macro-usage]

    macro 'NT_LOG_LEVEL_DEBUG' used to declare a constant; consider using a 'constexpr' constant

    #define NT_LOG_LEVEL_DEBUG 1
            ^
  • nuTens/logging.hpp:13:9: warning: [cppcoreguidelines-macro-usage]

    macro 'NT_LOG_LEVEL_INFO' used to declare a constant; consider using a 'constexpr' constant

    #define NT_LOG_LEVEL_INFO 2
            ^
  • nuTens/logging.hpp:14:9: warning: [cppcoreguidelines-macro-usage]

    macro 'NT_LOG_LEVEL_WARNING' used to declare a constant; consider using a 'constexpr' constant

    #define NT_LOG_LEVEL_WARNING 3
            ^
  • nuTens/logging.hpp:15:9: warning: [cppcoreguidelines-macro-usage]

    macro 'NT_LOG_LEVEL_ERROR' used to declare a constant; consider using a 'constexpr' constant

    #define NT_LOG_LEVEL_ERROR 4
            ^
  • nuTens/logging.hpp:16:9: warning: [cppcoreguidelines-macro-usage]

    macro 'NT_LOG_LEVEL_SILENT' used to declare a constant; consider using a 'constexpr' constant

    #define NT_LOG_LEVEL_SILENT 5
            ^
  • nuTens/logging.hpp:21:13: warning: [cppcoreguidelines-macro-usage]

    macro 'SPDLOG_ACTIVE_LEVEL' used to declare a constant; consider using a 'constexpr' constant

        #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE
                ^
  • nuTens/logging.hpp:42:10: error: [clang-diagnostic-error]

    'spdlog/spdlog.h' file not found

    #include "spdlog/spdlog.h"
             ^
  • nuTens/logging.hpp:48:38: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'runtimeLogLevel' is non-const and globally accessible, consider making it const

        static spdlog::level::level_enum runtimeLogLevel = spdlog::level::trace;
                                         ^
  • nuTens/logging.hpp:67:23: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'once' is non-const and globally accessible, consider making it const

    static std::once_flag once;
                          ^
  • nuTens/logging.hpp:81:9: warning: [cppcoreguidelines-macro-usage]

    variadic macro 'NT_TRACE' used; consider using a 'constexpr' variadic template function

    #define NT_TRACE(...) \
            ^
  • nuTens/logging.hpp:87:9: warning: [cppcoreguidelines-macro-usage]

    variadic macro 'NT_DEBUG' used; consider using a 'constexpr' variadic template function

    #define NT_DEBUG(...) \
            ^
  • nuTens/logging.hpp:93:9: warning: [cppcoreguidelines-macro-usage]

    variadic macro 'NT_INFO' used; consider using a 'constexpr' variadic template function

    #define NT_INFO(...) \
            ^
  • nuTens/logging.hpp:99:9: warning: [cppcoreguidelines-macro-usage]

    variadic macro 'NT_WARN' used; consider using a 'constexpr' variadic template function

    #define NT_WARN(...) \
            ^
  • nuTens/logging.hpp:105:9: warning: [cppcoreguidelines-macro-usage]

    variadic macro 'NT_ERROR' used; consider using a 'constexpr' variadic template function

    #define NT_ERROR(...) \
            ^
  • nuTens/nuTens-pch.hpp:5:10: warning: [modernize-deprecated-headers]

    inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead

    #include <math.h>
             ^~~~~~~~
             <cmath>
  • nuTens/nuTens-pch.hpp:11:10: error: [clang-diagnostic-error]

    'nuTens/logging.hpp' file not found

    #include <nuTens/logging.hpp>
             ^
  • nuTens/tensors/tensor.hpp:3:10: error: [clang-diagnostic-error]

    'nuTens/tensors/dtypes.hpp' file not found

    #include <nuTens/tensors/dtypes.hpp>
             ^
  • nuTens/tensors/tensor.hpp:45:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor &ones(int length, NTdtypes::scalarType type, NTdtypes::deviceType device = NTdtypes::kCPU, bool requiresGrad = true);
            ~~~~~~~~^
            auto                                                                                                                        -> Tensor &
  • nuTens/tensors/tensor.hpp:49:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor &ones(const std::vector<long int> &shape, NTdtypes::scalarType type, NTdtypes::deviceType device = NTdtypes::kCPU, bool requiresGrad = true);
            ~~~~~~~~^
            auto                                                                                                                                                -> Tensor &
  • nuTens/tensors/tensor.hpp:54:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor &zeros(int length, NTdtypes::scalarType type, NTdtypes::deviceType device = NTdtypes::kCPU, bool requiresGrad = true);
            ~~~~~~~~^
            auto                                                                                                                         -> Tensor &
  • nuTens/tensors/tensor.hpp:58:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor &zeros(const std::vector<long int> &shape, NTdtypes::scalarType type, NTdtypes::deviceType device = NTdtypes::kCPU, bool requiresGrad = true);
            ~~~~~~~~^
            auto                                                                                                                                                 -> Tensor &
  • nuTens/tensors/tensor.hpp:65:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor &dType(NTdtypes::scalarType type);
            ~~~~~~~~^
            auto                                     -> Tensor &
  • nuTens/tensors/tensor.hpp:67:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor &device(NTdtypes::deviceType device);
            ~~~~~~~~^
            auto                                        -> Tensor &
  • nuTens/tensors/tensor.hpp:69:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor &requiresGrad(bool reqGrad);
            ~~~~~~~~^
            auto                               -> Tensor &
  • nuTens/tensors/tensor.hpp:79:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor matmul(const Tensor &t1, const Tensor &t2);
                   ~~~~~~ ^
                   auto                                              -> Tensor
  • nuTens/tensors/tensor.hpp:84:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor outer(const Tensor &t1, const Tensor &t2);
                   ~~~~~~ ^
                   auto                                             -> Tensor
  • nuTens/tensors/tensor.hpp:89:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor mul(const Tensor &t1, const Tensor &t2);
                   ~~~~~~ ^
                   auto                                           -> Tensor
  • nuTens/tensors/tensor.hpp:94:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor div(const Tensor &t1, const Tensor &t2);
                   ~~~~~~ ^
                   auto                                           -> Tensor
  • nuTens/tensors/tensor.hpp:99:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor pow(const Tensor &t, float s);
                   ~~~~~~ ^
                   auto                                 -> Tensor
  • nuTens/tensors/tensor.hpp:103:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor pow(const Tensor &t, std::complex<float> s);
                   ~~~~~~ ^
                   auto                                               -> Tensor
  • nuTens/tensors/tensor.hpp:107:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor exp(const Tensor &t);
                   ~~~~~~ ^
                   auto                        -> Tensor
  • nuTens/tensors/tensor.hpp:113:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor transpose(const Tensor &t, int dim1, int dim2);
                   ~~~~~~ ^
                   auto                                                  -> Tensor
  • nuTens/tensors/tensor.hpp:118:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor scale(const Tensor &t, float s);
                   ~~~~~~ ^
                   auto                                   -> Tensor
  • nuTens/tensors/tensor.hpp:122:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor scale(const Tensor &t, std::complex<float> s);
                   ~~~~~~ ^
                   auto                                                 -> Tensor
  • nuTens/tensors/tensor.hpp:180:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            bool operator== (const Tensor &rhs) const;
            ~~~~ ^
            auto                                      -> bool
  • nuTens/tensors/tensor.hpp:181:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            bool operator!= (const Tensor &rhs) const;
            ~~~~ ^
            auto                                      -> bool
  • nuTens/tensors/tensor.hpp:182:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor operator+ (const Tensor &rhs) const;
            ~~~~~~ ^
            auto                                       -> Tensor
  • nuTens/tensors/tensor.hpp:183:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor operator- (const Tensor &rhs) const;
            ~~~~~~ ^
            auto                                       -> Tensor
  • nuTens/tensors/tensor.hpp:184:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor operator- () const;
            ~~~~~~ ^
            auto                      -> Tensor
  • nuTens/tensors/tensor.hpp:188:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor real() const;
            ~~~~~~ ^
            auto                -> Tensor
  • nuTens/tensors/tensor.hpp:190:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor imag() const;
            ~~~~~~ ^
            auto                -> Tensor
  • nuTens/tensors/tensor.hpp:192:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor conj() const;
            ~~~~~~ ^
            auto                -> Tensor
  • nuTens/tensors/tensor.hpp:194:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor abs() const;
            ~~~~~~ ^
            auto               -> Tensor
  • nuTens/tensors/tensor.hpp:196:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor angle() const;
            ~~~~~~ ^
            auto                 -> Tensor
  • nuTens/tensors/tensor.hpp:200:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor cumsum(int dim) const; 
            ~~~~~~ ^
            auto                         -> Tensor
  • nuTens/tensors/tensor.hpp:203:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor sum() const;
            ~~~~~~ ^
            auto               -> Tensor
  • nuTens/tensors/tensor.hpp:213:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor grad() const;
            ~~~~~~ ^
            auto                -> Tensor
  • nuTens/tensors/tensor.hpp:223:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor sin(const Tensor &t);
                   ~~~~~~ ^
                   auto                        -> Tensor
  • nuTens/tensors/tensor.hpp:227:23: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static Tensor cos(const Tensor &t);
                   ~~~~~~ ^
                   auto                        -> Tensor
  • nuTens/tensors/tensor.hpp:232:30: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            friend std::ostream &operator<< (std::ostream &stream, const Tensor &tensor) {
                   ~~~~~~~~~~~~~~^
                   auto                                                                  -> std::ostream &
  • nuTens/tensors/tensor.hpp:237:21: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            std::string toString() const ;
            ~~~~~~~~~~~ ^
            auto                         -> std::string
  • nuTens/tensors/tensor.hpp:243:23: warning: [readability-avoid-const-params-in-decls]

    parameter 1 is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions

            void setValue(const std::vector<std::variant<int, std::string>> &indices, const Tensor &value);
                          ^
  • nuTens/tensors/tensor.hpp:249:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor getValue(const std::vector<std::variant<int, std::string>> &indices) const;
            ~~~~~~ ^
            auto                                                                              -> Tensor
  • nuTens/tensors/tensor.hpp:249:25: warning: [readability-avoid-const-params-in-decls]

    parameter 1 is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions

            Tensor getValue(const std::vector<std::variant<int, std::string>> &indices) const;
                            ^
  • nuTens/tensors/tensor.hpp:252:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            size_t getNdim() const;
            ~~~~~~ ^
            auto                   -> size_t
  • nuTens/tensors/tensor.hpp:255:13: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            int getBatchDim() const;
            ~~~ ^
            auto                    -> int
  • nuTens/tensors/tensor.hpp:258:26: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            std::vector<int> getShape() const;
                             ^
  • nuTens/tensors/tensor.hpp:282:28: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            static std::string getTensorLibrary();
                   ~~~~~~~~~~~ ^
                   auto                           -> std::string
  • nuTens/propagator/base-matter-solver.hpp:3:10: error: [clang-diagnostic-error]

    'nuTens/tensors/tensor.hpp' file not found

    #include <nuTens/tensors/tensor.hpp>
             ^
  • nuTens/propagator/propagator.hpp:3:10: error: [clang-diagnostic-error]

    'nuTens/tensors/tensor.hpp' file not found

    #include <nuTens/tensors/tensor.hpp>
             ^
  • nuTens/propagator/propagator.hpp:27:9: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: _PMNSmatrix, _masses, _matterSolver

            Propagator(int nGenerations, float baseline)
            ^
  • nuTens/propagator/propagator.hpp:35:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor calculateProbs(const Tensor &energies) const;
                   ^
  • nuTens/propagator/propagator.hpp:82:16: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            Tensor _calculateProbs(const Tensor &energies, const Tensor &masses, const Tensor &PMNS) const;
                   ^
  • nuTens/propagator/propagator.hpp:84:5: warning: [readability-redundant-access-specifiers]

    redundant access specifier has the same accessibility as the previous access specifier

        private:
        ^~~~~~~~
  • nuTens/propagator/propagator.hpp:85:16: warning: [bugprone-reserved-identifier]

    declaration uses identifier '_PMNSmatrix', which is a reserved identifier

            Tensor _PMNSmatrix;
                   ^~~~~~~~~~~
                   PMNSmatrix
  • nuTens/propagator/const-density-solver.hpp:3:10: error: [clang-diagnostic-error]

    'nuTens/propagator/base-matter-solver.hpp' file not found

    #include <nuTens/propagator/base-matter-solver.hpp>
             ^
  • nuTens/propagator/const-density-solver.hpp:31:9: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: PMNS, masses, diagMassMatrix, electronOuter

            ConstDensityMatterSolver(int nGenerations, float density)
            ^
  • nuTens/propagator/const-density-solver.hpp:54:21: warning: [readability-make-member-function-const]

    method 'setMasses' can be made const

            inline void setMasses(const Tensor &newMasses) {
                        ^
                                                           const
  • nuTens/propagator/const-density-solver.hpp:60:23: warning: [cppcoreguidelines-init-variables]

    variable 'm_i' is not initialized

                    float m_i = masses.getValue<float>({0, i});
                          ^
                              = NAN
  • tests/two-flavour-const-matter.cpp:1:10: error: [clang-diagnostic-error]

    'nuTens/propagator/const-density-solver.hpp' file not found

    #include <nuTens/propagator/const-density-solver.hpp>
             ^
  • tests/two-flavour-const-matter.cpp:7:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    int main(){
    ~~~ ^
    auto       -> int
  • tests/two-flavour-const-matter.cpp:9:5: warning: [readability-isolate-declaration]

    multiple declarations in a single statement reduces readability

        float m1 = 1.0, m2 = 2.0;
        ^~~~~~~~~~~~~~~~~~~~~~~~~
  • tests/two-flavour-const-matter.cpp:14:12: warning: [cppcoreguidelines-init-variables]

    variable 'masses' is not initialized

        Tensor masses;
               ^
                      = 0
  • tests/two-flavour-const-matter.cpp:20:12: warning: [cppcoreguidelines-init-variables]

    variable 'energies' is not initialized

        Tensor energies;
               ^
                        = 0
  • tests/two-flavour-const-matter.cpp:27:30: warning: [cppcoreguidelines-init-variables]

    variable 'tensorSolver' is not initialized

        ConstDensityMatterSolver tensorSolver(2, density);
                                 ^
                                              = 0
  • tests/two-flavour-const-matter.cpp:31:22: warning: [cppcoreguidelines-init-variables]

    variable 'bargerProp' is not initialized

        TwoFlavourBarger bargerProp;
                         ^
                                    = 0
  • tests/two-flavour-const-matter.cpp:36:15: warning: [cppcoreguidelines-init-variables]

    variable 'theta' is not initialized

            float theta = ( -1.0 + 2.0 * (float)i / 20.0) * 0.49 * M_PI;
                  ^
                        = NAN
  • tests/two-flavour-const-matter.cpp:41:16: warning: [cppcoreguidelines-init-variables]

    variable 'PMNS' is not initialized

            Tensor PMNS;
                   ^
                        = 0
  • tests/two-flavour-const-matter.cpp:52:16: warning: [cppcoreguidelines-init-variables]

    variable 'eigenVals' is not initialized

            Tensor eigenVals, eigenVecs;
                   ^
                             = 0
  • tests/two-flavour-const-matter.cpp:60:15: warning: [cppcoreguidelines-init-variables]

    variable 'calcV1' is not initialized

            float calcV1 = eigenVals.getValue<float>({0, 0});
                  ^
                         = NAN
  • tests/two-flavour-const-matter.cpp:61:15: warning: [cppcoreguidelines-init-variables]

    variable 'calcV2' is not initialized

            float calcV2 = eigenVals.getValue<float>({0, 1});
                  ^
                         = NAN
  • tests/barger.cpp:1:10: error: [clang-diagnostic-error]

    'tests/barger-propagator.hpp' file not found

    #include <tests/barger-propagator.hpp>
             ^
  • tests/barger.cpp:10:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    int main(){
    ~~~ ^
    auto       -> int
  • tests/barger.cpp:14:22: warning: [cppcoreguidelines-init-variables]

    variable 'bargerProp' is not initialized

        TwoFlavourBarger bargerProp;
                         ^
                                    = 0
  • tests/tensor-basic.cpp:1:10: error: [clang-diagnostic-error]

    'nuTens/tensors/tensor.hpp' file not found

    #include <nuTens/tensors/tensor.hpp>
             ^
  • tests/tensor-basic.cpp:3:10: warning: [modernize-deprecated-headers]

    inclusion of deprecated C++ header 'complex.h'; consider using 'complex' instead

    #include <complex.h>
             ^~~~~~~~~~~
             <complex>
  • tests/tensor-basic.cpp:10:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    int main(){
    ~~~ ^
    auto       -> int
  • tests/tensor-basic.cpp:15:12: warning: [cppcoreguidelines-init-variables]

    variable 'tensorFloat' is not initialized

        Tensor tensorFloat;
               ^
                           = 0
  • tests/tensor-basic.cpp:32:12: warning: [cppcoreguidelines-init-variables]

    variable 'realSquared' is not initialized

        Tensor realSquared = Tensor::matmul(tensorFloat, tensorFloat);
               ^
                           = 0
  • tests/tensor-basic.cpp:40:12: warning: [cppcoreguidelines-init-variables]

    variable 'tensorComplex' is not initialized

        Tensor tensorComplex;
               ^
                             = 0
  • tests/tensor-basic.cpp:68:12: warning: [cppcoreguidelines-init-variables]

    variable 'imagSquared' is not initialized

        Tensor imagSquared = Tensor::matmul(tensorComplex, tensorComplex);
               ^
                           = 0
  • tests/tensor-basic.cpp:81:12: warning: [cppcoreguidelines-init-variables]

    variable 'ones' is not initialized

        Tensor ones;
               ^
                    = 0
  • tests/tensor-basic.cpp:83:12: warning: [cppcoreguidelines-init-variables]

    variable 'twos' is not initialized

        Tensor twos = ones + ones;
               ^
                    = 0
  • tests/tensor-basic.cpp:99:12: warning: [cppcoreguidelines-init-variables]

    variable 'ones_scaleTest' is not initialized

        Tensor ones_scaleTest;
               ^
                              = 0
  • tests/tensor-basic.cpp:101:12: warning: [cppcoreguidelines-init-variables]

    variable 'threes' is not initialized

        Tensor threes = Tensor::scale(ones_scaleTest, 3.0).sum();
               ^
                      = 0
  • tests/tensor-basic.cpp:103:12: warning: [cppcoreguidelines-init-variables]

    variable 'grad' is not initialized

        Tensor grad = ones_scaleTest.grad();
               ^
                    = 0
  • tests/tensor-basic.cpp:121:12: warning: [cppcoreguidelines-init-variables]

    variable 'complexGradTest' is not initialized

        Tensor complexGradTest;
               ^
                               = 0
  • tests/tensor-basic.cpp:129:12: warning: [cppcoreguidelines-init-variables]

    variable 'complexGradSquared' is not initialized

        Tensor complexGradSquared = Tensor::matmul(complexGradTest, complexGradTest).sum();
               ^
                                  = 0
  • tests/two-flavour-vacuum.cpp:1:10: error: [clang-diagnostic-error]

    'nuTens/propagator/propagator.hpp' file not found

    #include <nuTens/propagator/propagator.hpp>
             ^
  • tests/two-flavour-vacuum.cpp:7:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    int main(){
    ~~~ ^
    auto       -> int
  • tests/two-flavour-vacuum.cpp:9:5: warning: [readability-isolate-declaration]

    multiple declarations in a single statement reduces readability

        float m1 = 0.1, m2 = 0.5;
        ^~~~~~~~~~~~~~~~~~~~~~~~~
  • tests/two-flavour-vacuum.cpp:13:12: warning: [cppcoreguidelines-init-variables]

    variable 'masses' is not initialized

        Tensor masses;
               ^
                      = 0
  • tests/two-flavour-vacuum.cpp:19:12: warning: [cppcoreguidelines-init-variables]

    variable 'energies' is not initialized

        Tensor energies;
               ^
                        = 0
  • tests/two-flavour-vacuum.cpp:24:16: warning: [cppcoreguidelines-init-variables]

    variable 'tensorPropagator' is not initialized

        Propagator tensorPropagator(2, baseline);
                   ^
                                    = 0
  • tests/two-flavour-vacuum.cpp:28:22: warning: [cppcoreguidelines-init-variables]

    variable 'bargerProp' is not initialized

        TwoFlavourBarger bargerProp;
                         ^
                                    = 0
  • tests/two-flavour-vacuum.cpp:33:15: warning: [cppcoreguidelines-init-variables]

    variable 'theta' is not initialized

            float theta = ( -1.0 + 2.0 * (float)i / 20.0) * 0.49 * M_PI;
                  ^
                        = NAN
  • tests/two-flavour-vacuum.cpp:38:16: warning: [cppcoreguidelines-init-variables]

    variable 'PMNS' is not initialized

            Tensor PMNS;
                   ^
                        = 0
  • tests/two-flavour-vacuum.cpp:48:16: warning: [cppcoreguidelines-init-variables]

    variable 'probabilities' is not initialized

            Tensor probabilities = tensorPropagator.calculateProbs(energies);
                   ^
                                 = 0
  • nuTens/tensors/torch-tensor.cpp:2:10: error: [clang-diagnostic-error]

    'nuTens/tensors/tensor.hpp' file not found

    #include <nuTens/tensors/tensor.hpp>
             ^
  • nuTens/tensors/torch-tensor.cpp:6:49: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'scalarTypeMap' is non-const and globally accessible, consider making it const

    std::map<NTdtypes::scalarType, c10::ScalarType> scalarTypeMap = {
                                                    ^
  • nuTens/tensors/torch-tensor.cpp:14:49: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'deviceTypeMap' is non-const and globally accessible, consider making it const

    std::map<NTdtypes::deviceType, c10::DeviceType> deviceTypeMap = {
                                                    ^
  • nuTens/propagator/propagator.cpp:1:10: error: [clang-diagnostic-error]

    'nuTens/propagator/propagator.hpp' file not found

    #include <nuTens/propagator/propagator.hpp>
             ^
  • nuTens/propagator/const-density-solver.cpp:1:10: error: [clang-diagnostic-error]

    'nuTens/propagator/const-density-solver.hpp' file not found

    #include <nuTens/propagator/const-density-solver.hpp>
             ^

Have any feedback or feature suggestions? Share it here.

@ewanwm ewanwm merged commit 4c9d21e into main Jul 25, 2024
2 checks passed
@ewanwm ewanwm deleted the feature_readme_linter_badge branch July 25, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants