From 4662503d42e5c3ed5b781eee51ac2a37dfcf4aae Mon Sep 17 00:00:00 2001 From: Floriansimmer Date: Sat, 30 Jul 2022 22:29:29 +0200 Subject: [PATCH] Ci v2 (#7282) * Github: Build and Test Build and Test: - ccache - build - Unittest - install - Unittest of install - report misc: - use .clang-tidy file to configure Clang-tidy checks - use use .pylintrc to configure Pylint checks - Update changed-files Action - better regex for file extension filter - show enabled clang-tidy checks in Step Report - show enabled Pylint Checks - cpplint filter documentation - modified cpplint filters recomended by https://github.com/sider/runners/blob/HEAD/images/cpplint/sider_recommended_CPPLINT.cfg - fixed Branch filter for Clazy QT6 checks --> has only worked on pull requests - fail the CI only on Build errors, Unittest errors and misspellings * Github: remove Codespell action as it is now integrated into the check workflow --- .clang-tidy | 488 +++++++++++++++++++++++++ .github/workflows/checks.yml | 488 +++++++++++++++++++++---- .github/workflows/codespell.yml | 31 -- .pylintrc | 614 ++++++++++++++++++++++++++++++++ 4 files changed, 1511 insertions(+), 110 deletions(-) create mode 100644 .clang-tidy delete mode 100644 .github/workflows/codespell.yml create mode 100644 .pylintrc diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..713e242c85 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,488 @@ +--- +Checks: 'clang-diagnostic-*,clang-analyzer-*,boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,cppcoreguidelines-*,concurrency-*' +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: file +User: florians +CheckOptions: + - key: readability-suspicious-call-argument.PrefixSimilarAbove + value: '30' + - key: cppcoreguidelines-no-malloc.Reallocations + value: '::realloc' + - key: cppcoreguidelines-owning-memory.LegacyResourceConsumers + value: '::free;::realloc;::freopen;::fclose' + - key: bugprone-reserved-identifier.Invert + value: 'false' + - key: bugprone-narrowing-conversions.PedanticMode + value: 'false' + - key: bugprone-unused-return-value.CheckedFunctions + value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty;::std::back_inserter;::std::distance;::std::find;::std::find_if;::std::inserter;::std::lower_bound;::std::make_pair;::std::map::count;::std::map::find;::std::map::lower_bound;::std::multimap::equal_range;::std::multimap::upper_bound;::std::set::count;::std::set::find;::std::setfill;::std::setprecision;::std::setw;::std::upper_bound;::std::vector::at;::bsearch;::ferror;::feof;::isalnum;::isalpha;::isblank;::iscntrl;::isdigit;::isgraph;::islower;::isprint;::ispunct;::isspace;::isupper;::iswalnum;::iswprint;::iswspace;::isxdigit;::memchr;::memcmp;::strcmp;::strcoll;::strncmp;::strpbrk;::strrchr;::strspn;::strstr;::wcscmp;::access;::bind;::connect;::difftime;::dlsym;::fnmatch;::getaddrinfo;::getopt;::htonl;::htons;::iconv_open;::inet_addr;::isascii;::isatty;::mmap;::newlocale;::openat;::pathconf;::pthread_equal;::pthread_getspecific;::pthread_mutex_trylock;::readdir;::readlink;::recvmsg;::regexec;::scandir;::semget;::setjmp;::shm_open;::shmget;::sigismember;::strcasecmp;::strsignal;::ttyname' + - key: modernize-use-auto.MinTypeNameLength + value: '5' + - key: cppcoreguidelines-macro-usage.CheckCapsOnly + value: 'false' + - key: readability-inconsistent-declaration-parameter-name.Strict + value: 'false' + - key: readability-suspicious-call-argument.DiceDissimilarBelow + value: '60' + - key: bugprone-assert-side-effect.IgnoredFunctions + value: __builtin_expect + - key: readability-suspicious-call-argument.Equality + value: 'true' + - key: bugprone-easily-swappable-parameters.QualifiersMix + value: 'false' + - key: bugprone-suspicious-string-compare.WarnOnImplicitComparison + value: 'true' + - key: bugprone-argument-comment.CommentNullPtrs + value: '0' + - key: cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion + value: 'true' + - key: cppcoreguidelines-init-variables.IncludeStyle + value: llvm + - key: modernize-use-nodiscard.ReplacementString + value: '[[nodiscard]]' + - key: modernize-loop-convert.MakeReverseRangeHeader + value: '' + - key: readability-suspicious-call-argument.SuffixSimilarAbove + value: '30' + - key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion + value: 'true' + - key: bugprone-easily-swappable-parameters.IgnoredParameterNames + value: '"";iterator;Iterator;begin;Begin;end;End;first;First;last;Last;lhs;LHS;rhs;RHS' + - key: modernize-loop-convert.UseCxx20ReverseRanges + value: 'true' + - key: cppcoreguidelines-prefer-member-initializer.UseAssignment + value: 'false' + - key: performance-type-promotion-in-math-fn.IncludeStyle + value: llvm + - key: readability-function-cognitive-complexity.DescribeBasicIncrements + value: 'true' + - key: bugprone-suspicious-include.ImplementationFileExtensions + value: 'c;cc;cpp;cxx' + - key: modernize-loop-convert.MakeReverseRangeFunction + value: '' + - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros + value: 'true' + - key: bugprone-suspicious-missing-comma.SizeThreshold + value: '5' + - key: readability-identifier-naming.IgnoreFailedSplit + value: 'false' + - key: readability-qualified-auto.AddConstToQualified + value: 'true' + - key: bugprone-sizeof-expression.WarnOnSizeOfThis + value: 'true' + - key: bugprone-string-constructor.WarnOnLargeLength + value: 'true' + - key: cppcoreguidelines-explicit-virtual-functions.OverrideSpelling + value: override + - key: readability-uppercase-literal-suffix.IgnoreMacros + value: 'true' + - key: modernize-make-shared.IgnoreMacros + value: 'true' + - key: bugprone-dynamic-static-initializers.HeaderFileExtensions + value: ';h;hh;hpp;hxx' + - key: bugprone-suspicious-enum-usage.StrictMode + value: 'false' + - key: performance-unnecessary-copy-initialization.AllowedTypes + value: '' + - key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens + value: '5' + - key: modernize-use-transparent-functors.SafeMode + value: 'false' + - key: readability-suspicious-call-argument.Levenshtein + value: 'true' + - key: bugprone-not-null-terminated-result.WantToUseSafeFunctions + value: 'true' + - key: bugprone-string-constructor.LargeLengthThreshold + value: '8388608' + - key: readability-simplify-boolean-expr.ChainedConditionalAssignment + value: 'false' + - key: cppcoreguidelines-avoid-magic-numbers.IgnoreAllFloatingPointValues + value: 'false' + - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField + value: 'false' + - key: bugprone-exception-escape.FunctionsThatShouldNotThrow + value: '' + - key: performance-inefficient-vector-operation.EnableProto + value: 'false' + - key: modernize-make-shared.MakeSmartPtrFunction + value: 'std::make_shared' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: readability-suspicious-call-argument.PrefixDissimilarBelow + value: '25' + - key: readability-function-size.LineThreshold + value: '4294967295' + - key: bugprone-easily-swappable-parameters.MinimumLength + value: '2' + - key: portability-simd-intrinsics.Suggest + value: 'false' + - key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader + value: '' + - key: modernize-use-override.IgnoreDestructors + value: 'false' + - key: modernize-make-shared.MakeSmartPtrFunctionHeader + value: '' + - key: bugprone-sizeof-expression.WarnOnSizeOfConstant + value: 'true' + - key: readability-redundant-string-init.StringNames + value: '::std::basic_string_view;::std::basic_string' + - key: modernize-make-unique.IgnoreDefaultInitialization + value: 'true' + - key: modernize-use-emplace.ContainersWithPushBack + value: '::std::vector;::std::list;::std::deque' + - key: readability-magic-numbers.IgnoreBitFieldsWidths + value: 'true' + - key: modernize-make-unique.IncludeStyle + value: llvm + - key: modernize-use-override.OverrideSpelling + value: override + - key: readability-suspicious-call-argument.LevenshteinDissimilarBelow + value: '50' + - key: bugprone-argument-comment.CommentStringLiterals + value: '0' + - key: concurrency-mt-unsafe.FunctionSet + value: any + - key: readability-identifier-length.IgnoredExceptionVariableNames + value: '^[e]$' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: bugprone-reserved-identifier.AllowedIdentifiers + value: '' + - key: cppcoreguidelines-pro-type-member-init.IgnoreArrays + value: 'false' + - key: readability-else-after-return.WarnOnUnfixable + value: 'true' + - key: cppcoreguidelines-avoid-magic-numbers.IgnoredFloatingPointValues + value: '1.0;100.0;' + - key: modernize-use-emplace.IgnoreImplicitConstructors + value: 'false' + - key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros + value: 'true' + - key: readability-suspicious-call-argument.Substring + value: 'true' + - key: modernize-use-equals-delete.IgnoreMacros + value: 'true' + - key: readability-identifier-length.IgnoredVariableNames + value: '' + - key: readability-magic-numbers.IgnoreAllFloatingPointValues + value: 'false' + - key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle + value: llvm + - key: readability-suspicious-call-argument.Abbreviations + value: 'arr=array;cnt=count;idx=index;src=source;stmt=statement;cpy=copy;dest=destination;dist=distancedst=distance;ptr=pointer;wdth=width;str=string;ln=line;srv=server;attr=attribute;ref=reference;buf=buffer;col=column;nr=number;vec=vector;len=length;elem=element;val=value;i=index;var=variable;hght=height;cl=client;num=number;pos=position;lst=list;addr=address' + - key: bugprone-misplaced-widening-cast.CheckImplicitCasts + value: 'false' + - key: readability-uppercase-literal-suffix.NewSuffixes + value: '' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: performance-unnecessary-value-param.AllowedTypes + value: '' + - key: readability-uniqueptr-delete-release.PreferResetCall + value: 'false' + - key: readability-identifier-length.MinimumExceptionNameLength + value: '2' + - key: cppcoreguidelines-avoid-magic-numbers.IgnorePowersOf2IntegerValues + value: 'false' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: cppcoreguidelines-avoid-magic-numbers.IgnoreBitFieldsWidths + value: 'true' + - key: cppcoreguidelines-avoid-magic-numbers.IgnoredIntegerValues + value: '1;2;3;4;' + - key: cppcoreguidelines-no-malloc.Allocations + value: '::malloc;::calloc' + - key: bugprone-narrowing-conversions.IgnoreConversionFromTypes + value: '' + - key: readability-function-size.BranchThreshold + value: '4294967295' + - key: bugprone-suspicious-missing-comma.RatioThreshold + value: '0.200000' + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: 'false' + - key: readability-identifier-length.IgnoredParameterNames + value: '^[n]$' + - key: readability-function-size.StatementThreshold + value: '800' + - key: readability-identifier-naming.IgnoreMainLikeFunctions + value: 'false' + - key: cppcoreguidelines-init-variables.MathHeader + value: '' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: bugprone-reserved-identifier.AggressiveDependentMemberLookup + value: 'false' + - key: readability-suspicious-call-argument.DiceSimilarAbove + value: '70' + - key: modernize-use-equals-default.IgnoreMacros + value: 'true' + - key: readability-suspicious-call-argument.Abbreviation + value: 'true' + - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor + value: 'false' + - key: readability-identifier-length.MinimumLoopCounterNameLength + value: '2' + - key: modernize-use-emplace.SmartPointers + value: '::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr' + - key: cppcoreguidelines-no-malloc.Deallocations + value: '::free' + - key: bugprone-dangling-handle.HandleClasses + value: 'std::basic_string_view;std::experimental::basic_string_view' + - key: readability-magic-numbers.IgnorePowersOf2IntegerValues + value: 'false' + - key: readability-suspicious-call-argument.JaroWinklerSimilarAbove + value: '85' + - key: readability-simplify-subscript-expr.Types + value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array' + - key: performance-unnecessary-copy-initialization.ExcludedContainerTypes + value: '' + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: performance-move-const-arg.CheckTriviallyCopyableMove + value: 'true' + - key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold + value: '3' + - key: readability-function-size.VariableThreshold + value: '4294967295' + - key: cert-dcl16-c.NewSuffixes + value: 'L;LL;LU;LLU' + - key: bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion + value: 'true' + - key: readability-identifier-naming.GetConfigPerFile + value: 'true' + - key: modernize-use-default-member-init.UseAssignment + value: 'false' + - key: readability-function-size.NestingThreshold + value: '4294967295' + - key: modernize-use-override.AllowOverrideAndFinal + value: 'false' + - key: cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes + value: '' + - key: readability-function-size.ParameterThreshold + value: '4294967295' + - key: modernize-pass-by-value.ValuesOnly + value: 'false' + - key: readability-function-cognitive-complexity.IgnoreMacros + value: 'false' + - key: modernize-loop-convert.IncludeStyle + value: llvm + - key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons + value: 'false' + - key: bugprone-narrowing-conversions.WarnWithinTemplateInstantiation + value: 'false' + - key: cert-err33-c.CheckedFunctions + value: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;' + - key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison + value: 'false' + - key: readability-redundant-smartptr-get.IgnoreMacros + value: 'true' + - key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal + value: 'false' + - key: readability-identifier-naming.AggressiveDependentMemberLookup + value: 'false' + - key: readability-identifier-length.MinimumParameterNameLength + value: '3' + - key: modernize-use-emplace.TupleTypes + value: '::std::pair;::std::tuple' + - key: modernize-use-emplace.TupleMakeFunctions + value: '::std::make_pair;::std::make_tuple' + - key: bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion + value: 'true' + - key: cppcoreguidelines-owning-memory.LegacyResourceProducers + value: '::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile' + - key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether + value: 'true' + - key: bugprone-argument-comment.StrictMode + value: '0' + - key: modernize-replace-random-shuffle.IncludeStyle + value: llvm + - key: modernize-use-bool-literals.IgnoreMacros + value: 'true' + - key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField + value: 'true' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: bugprone-suspicious-string-compare.StringCompareLikeFunctions + value: '' + - key: modernize-avoid-bind.PermissiveParameterList + value: 'false' + - key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold + value: '1' + - key: readability-suspicious-call-argument.Suffix + value: 'true' + - key: readability-suspicious-call-argument.JaroWinklerDissimilarBelow + value: '75' + - key: modernize-use-noexcept.ReplacementString + value: '' + - key: modernize-use-override.FinalSpelling + value: final + - key: modernize-use-using.IgnoreMacros + value: 'true' + - key: cppcoreguidelines-explicit-virtual-functions.FinalSpelling + value: final + - key: readability-suspicious-call-argument.MinimumIdentifierNameLength + value: '3' + - key: bugprone-narrowing-conversions.WarnOnIntegerNarrowingConversion + value: 'true' + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: cppcoreguidelines-pro-type-member-init.UseAssignment + value: 'false' + - key: bugprone-suspicious-include.HeaderFileExtensions + value: ';h;hh;hpp;hxx' + - key: performance-no-automatic-move.AllowedTypes + value: '' + - key: readability-suspicious-call-argument.SubstringDissimilarBelow + value: '40' + - key: bugprone-argument-comment.CommentIntegerLiterals + value: '0' + - key: bugprone-stringview-nullptr.IncludeStyle + value: llvm + - key: performance-for-range-copy.WarnOnAllAutoCopies + value: 'false' + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: bugprone-argument-comment.CommentFloatLiterals + value: '0' + - key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit + value: '16' + - key: readability-simplify-boolean-expr.ChainedConditionalReturn + value: 'false' + - key: readability-else-after-return.WarnOnConditionVariables + value: 'true' + - key: modernize-use-nullptr.NullMacros + value: 'NULL' + - key: readability-suspicious-call-argument.SuffixDissimilarBelow + value: '25' + - key: bugprone-argument-comment.CommentCharacterLiterals + value: '0' + - key: cppcoreguidelines-macro-usage.AllowedRegexp + value: '^DEBUG_*' + - key: readability-suspicious-call-argument.LevenshteinSimilarAbove + value: '66' + - key: cppcoreguidelines-narrowing-conversions.PedanticMode + value: 'false' + - key: modernize-make-shared.IgnoreDefaultInitialization + value: 'true' + - key: readability-suspicious-call-argument.JaroWinkler + value: 'true' + - key: bugprone-implicit-widening-of-multiplication-result.UseCXXHeadersInCppSources + value: 'true' + - key: modernize-make-shared.IncludeStyle + value: llvm + - key: readability-suspicious-call-argument.Prefix + value: 'true' + - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions + value: 'false' + - key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources + value: 'true' + - key: bugprone-signed-char-misuse.CharTypdefsToIgnore + value: '' + - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors + value: 'false' + - key: modernize-make-unique.IgnoreMacros + value: 'true' + - key: performance-for-range-copy.AllowedTypes + value: '' + - key: bugprone-argument-comment.CommentBoolLiterals + value: '0' + - key: readability-braces-around-statements.ShortStatementLines + value: '0' + - key: bugprone-argument-comment.CommentUserDefinedLiterals + value: '0' + - key: readability-magic-numbers.IgnoredFloatingPointValues + value: '1.0;100.0;' + - key: performance-inefficient-string-concatenation.StrictMode + value: 'false' + - key: readability-redundant-declaration.IgnoreMacros + value: 'true' + - key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes + value: 'bool;Bool;_Bool;it;It;iterator;Iterator;inputit;InputIt;forwardit;ForwardIt;bidirit;BidirIt;constiterator;const_iterator;Const_Iterator;Constiterator;ConstIterator;RandomIt;randomit;random_iterator;ReverseIt;reverse_iterator;reverse_const_iterator;ConstReverseIterator;Const_Reverse_Iterator;const_reverse_iterator;Constreverseiterator;constreverseiterator' + - key: modernize-make-unique.MakeSmartPtrFunction + value: 'std::make_unique' + - key: portability-restrict-system-includes.Includes + value: '*' + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: 'false' + - key: modernize-make-unique.MakeSmartPtrFunctionHeader + value: '' + - key: bugprone-signal-handler.AsyncSafeFunctionSet + value: POSIX + - key: bugprone-easily-swappable-parameters.ModelImplicitConversions + value: 'true' + - key: readability-suspicious-call-argument.SubstringSimilarAbove + value: '50' + - key: cppcoreguidelines-narrowing-conversions.WarnWithinTemplateInstantiation + value: 'false' + - key: readability-identifier-length.MinimumVariableNameLength + value: '3' + - key: cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth + value: 'true' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnorePublicMemberVariables + value: 'false' + - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted + value: 'false' + - key: modernize-use-noexcept.UseNoexceptFalse + value: 'true' + - key: readability-function-cognitive-complexity.Threshold + value: '25' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: 'true' + - key: bugprone-argument-comment.IgnoreSingleArgument + value: '0' + - key: bugprone-narrowing-conversions.WarnOnEquivalentBitWidth + value: 'true' + - key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression + value: 'false' + - key: performance-faster-string-find.StringLikeClasses + value: '::std::basic_string;::std::basic_string_view' + - key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion + value: 'true' + - key: bugprone-assert-side-effect.CheckFunctionCalls + value: 'false' + - key: bugprone-string-constructor.StringNames + value: '::std::basic_string;::std::basic_string_view' + - key: bugprone-assert-side-effect.AssertMacros + value: assert,NSAssert,NSCAssert + - key: bugprone-exception-escape.IgnoredExceptions + value: '' + - key: bugprone-signed-char-misuse.DiagnoseSignedUnsignedCharComparisons + value: 'true' + - key: modernize-use-default-member-init.IgnoreMacros + value: 'true' + - key: llvm-qualified-auto.AddConstToQualified + value: 'false' + - key: llvm-else-after-return.WarnOnConditionVariables + value: 'false' + - key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant + value: 'true' + - key: modernize-raw-string-literal.DelimiterStem + value: lit + - key: readability-suspicious-call-argument.Dice + value: 'true' + - key: readability-identifier-length.IgnoredLoopCounterNames + value: '^[ijk_]$' + - key: modernize-raw-string-literal.ReplaceShorterLiterals + value: 'false' + - key: readability-magic-numbers.IgnoredIntegerValues + value: '1;2;3;4;' + - key: performance-inefficient-vector-operation.VectorLikeClasses + value: '::std::vector' + - key: modernize-use-auto.RemoveStars + value: 'false' + - key: bugprone-implicit-widening-of-multiplication-result.IncludeStyle + value: llvm + - key: portability-simd-intrinsics.Std + value: '' + - key: performance-unnecessary-value-param.IncludeStyle + value: llvm + - key: readability-redundant-member-init.IgnoreBaseInCopyConstructors + value: 'false' + - key: modernize-replace-disallow-copy-and-assign-macro.MacroName + value: DISALLOW_COPY_AND_ASSIGN + - key: llvm-else-after-return.WarnOnUnfixable + value: 'false' +... + diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2a4ca8aac2..fb14680d5c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -6,12 +6,22 @@ on: permissions: pull-requests: write - + contents: write env: logdir: logs/ fixesdir: fixes/ + # Build and Test + buildFailSilent: false + test: true # run Unit tests + testFailSilent: false # don't fail CI if Unittests fail + + testInstall: true # run CMake install and Unit tests on install + installFailSilent: false # don't fail if CMake install fails + testInstallFailSilent: false # don't fail CI if Unittests fail + + # Linting checkWhitespace: true whitespaceFailSilent: true @@ -22,22 +32,17 @@ env: qtconnectionSyntaxFailSilent: true checkCpplint: true - cpplintFilters: -build/header_guard,-readability/braces,-whitespace,-build/include_order,-readability/todo + # This option allows you to specify a comma-separated list of rule-filters to apply. For example, the rule names look like whitespace/indent. In that case, the category is whitespace. + # To turn off, specify - as prefix like -whitespace or -whitespace/indent. On the other hand, to turn on, specify + like +whitespace or +whitespace/indent. + # The recommended filters are taken from https://github.com/sider/runners/blob/HEAD/images/cpplint/sider_recommended_CPPLINT.cfg + cpplintFilters: -build/c++11,-build/header_guard,-build/include,-build/include_alpha,-build/include_order,-build/include_subdir,-build/include_what_you_use,-build/namespaces,-legal/copyright,-readability/braces,-readability/casting,-readability/namespace,-readability/todo,-runtime/int,-runtime/references,-whitespace/blank_line,-whitespace/braces,-whitespace/comments,-whitespace/end_of_line,-whitespace/indent,-whitespace/line_length,-whitespace/newline,-whitespace/operators,-whitespace/parens,-whitespace/tab cpplintLineLength: 120 cpplintFailSilent: true checkPylint: true - pylintDisable: E0401,C0301,C0103,R0801,W0125 + pylintDisable: # additional disables to the .pylintrc file # for the Message codes see: https://pylint.pycqa.org/en/latest/user_guide/messages/index.html - # E0401: Unable to import '*' (import-error) - # C0103: Function name "*" doesn't conform to snake_case naming style (invalid-name) - # C0301: Line too long (118/100) (line-too-long) - # C0115: Missing class docstring (missing-class-docstring) - # C0116: Missing function or method docstring (missing-function-docstring) - # C0411: standard import "import *" should be placed before "import *" (wrong-import-order) - # R0801: Similar lines in 2 files --> not useful for us because not all files will be checked - # W0125: Using a conditional statement with a constant value (using-constant-test) --> often used for testing/debugging purposes in the Path module - pylintFailSilent: false + pylintFailSilent: true checkBlack: true blackFailSilent: true @@ -51,21 +56,26 @@ env: skip: ./.git,*.po,*.ts,*.svg,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/ codespellFailSilent: false + # Static Analysis checkClangTidy: true - clangTidyChecks: boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*,concurrency-* - clangTidyFailSilent: true + # for the Message codes see: https://clang-tidy.llvm.org/checks/index.html + clangTidyChecks: # empty to use the .clang-tidy file + clangTidyFailSilent: true # if false, the CI will fail if clang-tidy finds errors. Warnings or notes will not fail the CI checkClazy: true - clazyChecks: level1 # https://invent.kde.org/sdk/clazy#list-of-checks - clazyFailSilent: false + # for the Message codes see: https://invent.kde.org/sdk/clazy#list-of-checks + clazyChecks: level1 + clazyFailSilent: true # if false, the CI will fail if clazy finds errors. Warnings or notes will not fail the CI checkClazyQT6: true clazyQT6Checks: qt6-deprecated-api-fixes,qt6-header-fixes,qt6-qhash-signature,qt6-fwd-fixes,missing-qobject-macro # for QT6 Porting https://invent.kde.org/sdk/clazy#list-of-checks QT6Branch: master # branch to check for QT6 Porting - clazyQT6FailSilent: false + clazyQT6FailSilent: true # if false, the CI will fail if clazy finds errors. Warnings or notes will not fail the CI + # Reporting reportStepSummary: true - reportPRComment: false + reportPRComment: false # disabled because of permission hell (and the comments are to big for Github) + reportPushComment: false # disabled because of permission hell (and the comments are to big for Github) jobs: checks: @@ -76,7 +86,7 @@ jobs: with: fetch-depth: 2 - - name: Install dependencies + - name: Install FreeCAD dependencies id: install-dependencies run: | sudo apt-get update -qq @@ -146,21 +156,57 @@ jobs: shiboken2 \ imagemagick - - name: make Log and Fixes directory + - name: Get Date + if: always() + id: get-date + run: | + echo "::set-output name=date::$(/bin/date -u "+%Y%m%d%H%M")" + shell: bash + + - name: Install ccache + if: always() + run: | + sudo apt-get update -qq + sudo apt-get install -y --no-install-recommends ccache + + - name: make directories + if: always() run: | mkdir -p ${{ env.logdir }} mkdir -p ${{ env.fixesdir }} + mkdir -p ~/.ccache + + - name: Restore Compiler Cache + if: always() + uses: pat-s/always-upload-cache@v3 + with: + path: | + ~/.ccache + key: CI-cache-${{ steps.get-date.outputs.date }}-${{ github.run_number }} + restore-keys: | + CI-cache-${{ steps.get-date.outputs.date }}- + CI-cache- + + - name: Configure Cache + if: always() + run: | + ccache -z -M 1G + ccache --show-config + ccache -s + - name: Job summary Header + if: always() id: header run: | echo '# Check Results: :rocket:' >> ${{ env.logdir }}checkReport.md - name: Get changed files + if: always() id: changed-files - uses: tj-actions/changed-files@v12.2 + uses: tj-actions/changed-files@v24 - - name: List all changed Files + - name: Report all changed Files id: list-changed-files run: | echo "
:clipboard: Changed Files:" >> ${{ env.logdir }}checkReport.md @@ -177,6 +223,7 @@ jobs: id: harmonize-line-endings shell: bash run: | + # harmonize line endings in all changed files (Windows -> Unix) for file in ${{ steps.changed-files.outputs.all_changed_files }}; do if [ -f "$file" ]; then echo "Harmonizing line endings in $file" @@ -185,17 +232,250 @@ jobs: done - name: filter files by extensions + if: always() id: files-by-extensions shell: bash run: | changed_files=$( echo ${{ steps.changed-files.outputs.all_changed_files }} ) - py=$(grep -oE '\S*?\.(py|py3)' <<< $changed_files | tr '\n' ' ') || true # grep returns non-zero exit code if no match is found - cpp=$(grep -oE '\S*?\.(c|c++|cc|cpp|cu|cuh|cxx|h|h++|hh|hpp|hxx)' <<< $changed_files | tr '\n' ' ') || true + py=$(grep -oE '\S+\.(py|py3)' <<< $changed_files | tr '\n' ' ') || true # grep returns non-zero exit code if no match is found + cpp=$(grep -oE '\S+\.(c|c\+\+|cc|cpp|cu|cuh|cxx|h|h\+\+|hh|hpp|hxx)' <<< $changed_files | tr '\n' ' ') || true echo "::set-output name=python_files::$py" echo "::set-output name=cpp_files::$cpp" + echo "Python Files: $py" + echo "C++ Files: $cpp" - - name: Tests Header + - name: CMake Configure + id: configure + if: always() + run: | + set +e + + cmake \ + -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \ + -B build/ > ${{ env.logdir }}Cmake.log 2> ${{ env.logdir }}CmakeErrors.log + + exitCode=$? + + # Build Header in Report + echo '### Build:' >> ${{ env.logdir }}checkReport.md + + # Write the configure report + if [ $exitCode -eq 0 ] ; then + echo "
:heavy_check_mark: CMake configure succeeded" >> ${{ env.logdir }}checkReport.md + else + echo "
:fire: CMake configure failed" >> ${{ env.logdir }}checkReport.md + fi + echo "" >> ${{ env.logdir }}checkReport.md + echo "Configure Error Log (stderr output):" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}CmakeErrors.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "Configure Log (stdout output):" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + tail -n 60 ${{ env.logdir }}Cmake.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "
">> ${{ env.logdir }}checkReport.md + echo "" >> ${{ env.logdir }}checkReport.md + + cat ${{ env.logdir }}CmakeErrors.log + echo "::group::Configure Log" + cat ${{ env.logdir }}Cmake.log + echo "::endgroup::" + + exit $exitCode + + - name: Print ccache statistics before Build + if: always() + run: ccache -s + + - name: CMake Build + id: build + if: always() + run: | + set +e + + cmake --build build/ > ${{ env.logdir }}Build.log 2> ${{ env.logdir }}BuildErrors.log + + exitCode=$? + + # Write the build report + if [ $exitCode -eq 0 ] ; then + echo "
:heavy_check_mark: CMake build succeeded" >> ${{ env.logdir }}checkReport.md + else + echo "
:fire: CMake build failed" >> ${{ env.logdir }}checkReport.md + fi + echo "" >> ${{ env.logdir }}checkReport.md + echo "Build Error Log (stderr output):" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}BuildErrors.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "Build Log (stdout output trimmed to the last 100 Lines):" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + tail -n 50 ${{ env.logdir }}Build.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "
">> ${{ env.logdir }}checkReport.md + echo "" >> ${{ env.logdir }}checkReport.md + + # Print the Log to the console + cat ${{ env.logdir }}BuildErrors.log + echo "::group::Build Log" + cat ${{ env.logdir }}Build.log + echo "::endgroup::" + + # Exit the step with the exit code of the build + if [ ${{ env.buildFailSilent }} != true ]; then + exit $exitCode + else + echo "Build exited with code $exitCode, but we are ignoring it" + exit 0 + fi + + - name: Print ccache statistics after Build + if: always() + run: ccache -s + + - name: FreeCAD UnitTests + id: test + if: env.test == 'true' && always() + run: | + set +e + + build/bin/FreeCADCmd -t 0 &> ${{ env.logdir }}Test.log + + exitCode=$? + + # Trim the Log file + # remove "(xx %)" + sed -E '/\t+\([[:digit:]]{1,3} %\)\t/d' ${{ env.logdir }}Test.log > ${{ env.logdir }}TestTrimmed.log + + # Write the test report + if [ $exitCode -eq 0 ] ; then + echo "
:heavy_check_mark: Unittests succeeded" >> ${{ env.logdir }}checkReport.md + else + echo "
:fire: CMake test failed" >> ${{ env.logdir }}checkReport.md + fi + echo "" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + tail -n 100 ${{ env.logdir }}TestTrimmed.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "
">> ${{ env.logdir }}checkReport.md + echo "" >> ${{ env.logdir }}checkReport.md + + # Print the Log to the console + cat ${{ env.logdir }}Test.log + + # Exit the step with the exit code of the UnitTests + if [ ${{ env.testFailSilent }} != true ]; then + exit $exitCode + else + echo "Test exited with code $exitCode, but we are ignoring it" + exit 0 + fi + + - name: CMake Install + id: install + if: env.testInstall == 'true' && always() + run: | + set +e + + # Run the CMake Configure step again to update the install path + cmake \ + -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \ + -D CMAKE_INSTALL_PREFIX='/usr/lib/freecad' \ + -D CMAKE_INSTALL_BINDIR='/usr/lib/freecad/bin' \ + -D CMAKE_INSTALL_LIBDIR='/usr/lib/freecad/lib' \ + -D CMAKE_INSTALL_DATADIR='/usr/share/freecad' \ + -D CMAKE_INSTALL_DATAROOTDIR='/usr/share' \ + -D CMAKE_INSTALL_DOCDIR='/usr/share/doc/freecad' \ + -B build/ >> ${{ env.logdir }}Install.log 2>> ${{ env.logdir }}InstallErrors.log + + # Build again to copy the files to the install path + cmake --build build/ >> ${{ env.logdir }}Install.log 2>> ${{ env.logdir }}InstallErrors.log + + # Run CMake Install + sudo cmake --install build/ >> ${{ env.logdir }}Install.log 2>> ${{ env.logdir }}InstallErrors.log + + exitCode=$? + + # links for bin + FILES=/usr/lib/freecad/bin/* + for f in $FILES + do + sudo ln -vs /usr/lib/freecad/bin/$(basename $f) /usr/bin/$(basename $f) + done + + # Write the install report + if [ $exitCode -eq 0 ] ; then + echo "
:heavy_check_mark: CMake install succeeded" >> ${{ env.logdir }}checkReport.md + else + echo "
:fire: CMake install failed" >> ${{ env.logdir }}checkReport.md + fi + echo "" >> ${{ env.logdir }}checkReport.md + echo "Install Error Log (stderr output):" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}InstallErrors.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "Install Error Log (stdout output trimmed to the last 100 Lines):" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + tail -n 100 ${{ env.logdir }}Install.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "
">> ${{ env.logdir }}checkReport.md + echo "" >> ${{ env.logdir }}checkReport.md + + # Print the Log to the console + cat ${{ env.logdir }}InstallErrors.log + echo "::group::Install Log" + cat ${{ env.logdir }}Install.log + echo "::endgroup::" + + # Exit the step with the exit code of the Install + if [ ${{ env.cmakeInstallFailSilent }} != true ]; then + exit $exitCode + else + echo "CMake install exited with code $exitCode, but we are ignoring it" + exit 0 + fi + + - name: FreeCAD UnitTests on Install + id: testInstall + if: env.testInstall == 'true' && always() + run: | + set +e + + LD_LIBRARY_PATH=/usr/lib/freecad/lib FreeCADCmd -t 0 &> ${{ env.logdir }}TestInstall.log + + exitCode=$? + + # Trim the Log file + # remove "(xx %)" + sed -E '/\t+\([[:digit:]]{1,3} %\)\t/d' ${{ env.logdir }}TestInstall.log > ${{ env.logdir }}TestInstallTrimmed.log + + # Write the testInstall report + if [ $exitCode -eq 0 ] ; then + echo "
:heavy_check_mark: Unittests on install succeeded" >> ${{ env.logdir }}checkReport.md + else + echo "
:fire: CMake test on install failed" >> ${{ env.logdir }}checkReport.md + fi + echo "" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + tail -n 100 ${{ env.logdir }}TestInstallTrimmed.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "
">> ${{ env.logdir }}checkReport.md + echo "" >> ${{ env.logdir }}checkReport.md + + # Print the Log to the console + cat ${{ env.logdir }}TestInstall.log + + # Exit the step with the exit code of the UnitTests + if [ ${{ env.testInstallFailSilent }} != true ]; then + exit $exitCode + else + echo "Test on install exited with code $exitCode, but we are ignoring it" + exit 0 + fi + + - name: Report Tests header if: always() id: tests-header run: | @@ -213,6 +493,7 @@ jobs: grep -rnIHE --exclude="$exclude" " $" $file | sed 's/$/<-- trailing whitespace/' >> ${{ env.logdir }}whitespace.log || true done + # Write the Log to the console with the Problem Matchers if [ -f ${{ env.logdir }}whitespace.log ]; then echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/grepMatcherWarning.json" cat ${{ env.logdir }}whitespace.log @@ -225,12 +506,12 @@ jobs: echo "whitespaceErrors=$whitespaceErrors" >> $GITHUB_ENV - if [ "$whitespaceErrors" -gt 0 ]; then - # Write the report + # Write the report + if [ $whitespaceErrors -gt 0 ]; then echo "
:information_source: Found $whitespaceErrors trailing whitespace" >> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}whitespace.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}whitespace.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md else @@ -238,7 +519,8 @@ jobs: fi echo "" >> ${{ env.logdir }}checkReport.md - if [ "$whitespaceErrors" -gt 0 ] && [ ${{ env.whitespaceFailSilent }} != true ]; then + # Exit the step with the exit code + if [ $whitespaceErrors -gt 0 ] && [ ${{ env.whitespaceFailSilent }} != true ]; then exit 1 else exit 0 @@ -256,7 +538,7 @@ jobs: grep -rnIHE --exclude="$exclude" $'\t' $file | sed 's/$/ <-- contains tab/' >> ${{ env.logdir }}tab.log || true done - # Parse the log + # Write the Log to the console with the Problem Matchers if [ -f ${{ env.logdir }}tab.log ]; then echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/grepMatcherWarning.json" cat ${{ env.logdir }}tab.log @@ -269,11 +551,12 @@ jobs: echo "tabErrors=$tabErrors" >> $GITHUB_ENV - if [ "$tabErrors" -gt 0 ]; then + # Write the report + if [ $tabErrors -gt 0 ]; then echo "
:information_source: Found $tabErrors tabs, better to use spaces" >> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}tab.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}tab.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md else @@ -281,7 +564,8 @@ jobs: fi echo "" >> ${{ env.logdir }}checkReport.md - if [ "$tabErrors" -gt 0 ] && [ ${{ env.tabsFailSilent }} != true ]; then + # Exit the step with the exit code + if [ $tabErrors -gt 0 ] && [ ${{ env.tabsFailSilent }} != true ]; then exit 1 else exit 0 @@ -314,13 +598,13 @@ jobs: echo "Found $qtconnectionSyntax QT string-based connections" # Step-Report - if [ "$qtconnectionSyntax" -gt 0 ]; then + if [ $qtconnectionSyntax -gt 0 ]; then echo "
:information_source: Found $qtconnectionSyntax QT string-based connections :arrow_right: consider using QT functor-Based Connections" >> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md # documentation link echo "For more information see: https://wiki.qt.io/New_Signal_Slot_Syntax or https://github.com/FreeCAD/FreeCAD/issues/6166" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}stringSyntax.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}stringSyntax.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md else @@ -328,7 +612,8 @@ jobs: fi echo "" >> ${{ env.logdir }}checkReport.md - if [ "$qtconnectionSyntax" -gt 0 ] && [ ${{ env.qtconnectionSyntaxFailSilent }} != true ]; then + # Exit the step with the exit code + if [ $qtconnectionSyntax -gt 0 ] && [ ${{ env.qtconnectionSyntaxFailSilent }} != true ]; then exit 1 else exit 0 @@ -339,8 +624,6 @@ jobs: if: env.checkCpplint == 'true' && steps.files-by-extensions.outputs.cpp_files != '' && always() run: | cpplintErrors="0" - #filters="--filter=-build/header_guard,-readability/braces,-whitespace" - #linelength="--linelength=120" pip install cpplint @@ -364,7 +647,7 @@ jobs: echo "Found $cpplintErrors cpplint errors" # Step-Report - if [ "$cpplintErrors" -gt 0 ]; then + if [ $cpplintErrors -gt 0 ]; then echo "
:warning: CppLint found $cpplintErrors errors / warnings" >> ${{ env.logdir }}checkReport.md else echo "
:heavy_check_mark: No cpplint errors found " >> ${{ env.logdir }}checkReport.md @@ -372,12 +655,13 @@ jobs: echo "" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}cpplint.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}cpplint.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md - if [ "$cpplintErrors" -gt 0 ] && [ ${{ env.cpplintFailSilent }} != true ]; then + # Exit the step with the exit code + if [ $cpplintErrors -gt 0 ] && [ ${{ env.cpplintFailSilent }} != true ]; then exit 1 else exit 0 @@ -387,6 +671,8 @@ jobs: shell: bash if: env.checkPylint == 'true' && steps.files-by-extensions.outputs.python_files != '' && always() run: | + set +e + pylintErrors="0" pip install pylint @@ -396,8 +682,13 @@ jobs: pylintRefactorings="0" pylintConventions="0" + # List enabled pylint checks + pylint --list-msgs-enabled > ${{ env.logdir }}pylint-enabled-checks.log + # Run pylint on all python files - pylint --exit-zero --reports y --disable=${{ env.pylintDisable }} ${{ steps.files-by-extensions.outputs.python_files }} > ${{ env.logdir }}pylint.log + pylint --disable=${{ env.pylintDisable }} ${{ steps.files-by-extensions.outputs.python_files }} > ${{ env.logdir }}pylint.log + + exitCode=$? # if pylint has run successfully, then parse the output if [ -f ${{ env.logdir }}pylint.log ]; then @@ -422,29 +713,38 @@ jobs: echo "Found $pylintErrors errors, $pylintWarnings warnings, $pylintRefactorings refactorings, $pylintConventions conventions" #Step-summary - if [ "$pylintErrors" -gt 0 ]; then + if [ $pylintErrors -gt 0 ]; then echo "
:fire: Pylint found :fire: $pylintErrors errors, :warning: $pylintWarnings warnings, :construction: $pylintRefactorings refactorings and :pencil2: $pylintConventions conventions" >> ${{ env.logdir }}checkReport.md - elif [ "$pylintWarnings" -gt 0 ]; then + elif [ $pylintWarnings -gt 0 ]; then echo "
:warning: Pylint found :warning: $pylintWarnings warnings, :construction: $pylintRefactorings refactorings and :pencil2: $pylintConventions conventions" >> ${{ env.logdir }}checkReport.md - elif [ "$pylintRefactorings" -gt 0 ]; then + elif [ $pylintRefactorings -gt 0 ]; then echo "
:construction: Pylint found :construction: $pylintRefactorings refactorings and :pencil2: $pylintConventions conventions" >> ${{ env.logdir }}checkReport.md - elif [ "$pylintConventions" -gt 0 ]; then + elif [ $pylintConventions -gt 0 ]; then echo "
:pencil2: Pylint found :pencil2: $pylintConventions conventions" >> ${{ env.logdir }}checkReport.md else echo "
:heavy_check_mark: No pylint errors found " >> ${{ env.logdir }}checkReport.md fi + echo "" >> ${{ env.logdir }}checkReport.md + # list enabled checks + echo "
:information_source: Enabled checks" >> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}pylint.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}pylint-enabled-checks.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "
">> ${{ env.logdir }}checkReport.md + echo "" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}pylint.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md # Error the step if pylint has found errors - if [ "$pylintErrors" -gt 0 ] && [ ${{ env.pylintFailSilent }} != true ]; then - exit 1 + if [ $pylintErrors -gt 0 ] && [ ${{ env.pylintFailSilent }} != true ]; then + exit $exitCode else + echo "Pylint exited with code $exitCode, but we are ignoring it" exit 0 fi @@ -452,13 +752,16 @@ jobs: shell: bash if: env.checkBlack == 'true' && steps.files-by-extensions.outputs.python_files != '' && always() run: | + set +e pip install black blackReformats="0" blackFails="0" - black --check ${{ steps.files-by-extensions.outputs.python_files }} &> ${{ env.logdir }}black.log || true + black --check ${{ steps.files-by-extensions.outputs.python_files }} &> ${{ env.logdir }}black.log + + exitCode=$? # if black has run successfully, then parse the output if [ -f ${{ env.logdir }}black.log ]; then @@ -477,7 +780,7 @@ jobs: echo "Found $blackReformats files would be reformatted and $blackFails files would fail to reformat" #Step-summary - if [ "$blackReformats" -gt 0 ] || [ "$blackFails" -gt 0 ] ; then + if [ $blackReformats -gt 0 ] || [ $blackFails -gt 0 ] ; then echo "
:pencil2: Black would reformat $blackReformats files" >> ${{ env.logdir }}checkReport.md else echo "
:heavy_check_mark: Black would reformat no file" >> ${{ env.logdir }}checkReport.md @@ -485,14 +788,15 @@ jobs: echo "" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}black.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}black.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md - if [ "$blackReformats" -gt 0 ] && [ ${{ env.blackFailSilent }} != true ]; then - exit 1 + if [ $exitCode -gt 0 ] && [ ${{ env.blackFailSilent }} != true ]; then + exit $exitCode else + echo "Black exited with code $exitCode, but we are ignoring it" exit 0 fi @@ -521,7 +825,7 @@ jobs: # Report - if [ "$clangFormatErrors" -gt 0 ]; then + if [ $clangFormatErrors -gt 0 ]; then echo "
:pencil2: Clang-format would reformat $clangFormatErrors files" >> ${{ env.logdir }}checkReport.md else echo "
:heavy_check_mark: Clang-format would reformat no file " >> ${{ env.logdir }}checkReport.md @@ -529,12 +833,12 @@ jobs: echo "" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}clang-format.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}clang-format.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md - if [ "$clangFormatErrors" -gt 0 ] && [ ${{ env.clangFormatFailSilent }} != true ]; then + if [ $clangFormatErrors -gt 0 ] && [ ${{ env.clangFormatFailSilent }} != true ]; then exit 1 else exit 0 @@ -565,7 +869,7 @@ jobs: echo "Found $misspellings misspellings" #Step-summary - if [ "$misspellings" -gt 0 ]; then + if [ $misspellings -gt 0 ]; then echo "
:pencil2: Codespell found $misspellings misspellings" >> ${{ env.logdir }}checkReport.md else echo "
:heavy_check_mark: Codespell found no misspellings" >> ${{ env.logdir }}checkReport.md @@ -575,35 +879,35 @@ jobs: # documentation link echo "To ignore false positives, append the word to the [.github/codespellignore](https://github.com/FreeCAD/FreeCAD/blob/c38e88c61b8926f725215da88940025c94be1daa/.github/codespellignore) file (lowercase)" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}codespell.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}codespell.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md # Error the step if pylint has found errors - if [ "$misspellings" -gt 0 ] && [ ${{ env.codespellFailSilent }} != true ]; then + if [ $misspellings -gt 0 ] && [ ${{ env.codespellFailSilent }} != true ]; then exit 1 else exit 0 fi - - name: CMake Configure - if: env.checkClangTidy == 'true' && steps.files-by-extensions.outputs.cpp_files != '' && always() - run: | - cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -B build/ > ${{ env.logdir }}Cmake.log - cat ${{ env.logdir }}Cmake.log - - name: Clang-tidy shell: bash if: env.checkClangTidy == 'true' && steps.files-by-extensions.outputs.cpp_files != '' && always() run: | + set +e + clangTidyErrors="0" clangTidyWarnings="0" clangTidyNotes="0" - sudo apt-get install clang-tidy + sudo apt-get install -y --no-install-recommends clang-tidy - clang-tidy --quiet --format-style=${{ env.clangStyle }} --export-fixes=${{ env.fixesdir }}clang-tidy.yaml -checks=${{ env.clangTidyChecks }} -p build/ ${{ steps.files-by-extensions.outputs.cpp_files }} &>> ${{ env.logdir }}clang-tidy.log || true + clang-tidy --quiet --format-style=${{ env.clangStyle }} --export-fixes=${{ env.fixesdir }}clang-tidy.yaml -checks=${{ env.clangTidyChecks }} -p build/ --explain-config &>> ${{ env.logdir }}clang-tidy-enabled-checks.log + + clang-tidy --quiet --format-style=${{ env.clangStyle }} --export-fixes=${{ env.fixesdir }}clang-tidy.yaml -checks=${{ env.clangTidyChecks }} -p build/ ${{ steps.files-by-extensions.outputs.cpp_files }} &>> ${{ env.logdir }}clang-tidy.log + + exitCode=$? # if clang-tidy has run successfully parse the output if [ -f ${{ env.logdir }}clang-tidy.log ]; then @@ -624,27 +928,36 @@ jobs: echo "Found $clangTidyErrors errors, $clangTidyWarnings warnings, $clangTidyNotes notes" # Step-Report - if [ "$clangTidyErrors" -gt 0 ]; then + if [ $clangTidyErrors -gt 0 ]; then echo "
:fire: Clang-Tidy found :fire: $clangTidyErrors errors, :warning: $clangTidyWarnings warnings and :pencil2: $clangTidyNotes notes" >> ${{ env.logdir }}checkReport.md - elif [ "$clangTidyWarnings" -gt 0 ]; then + elif [ $clangTidyWarnings -gt 0 ]; then echo "
:warning: Clang-Tidy found :warning: $clangTidyWarnings warnings and :pencil2: $clangTidyNotes notes" >> ${{ env.logdir }}checkReport.md - elif [ "$clangTidyNotes" -gt 0 ]; then + elif [ $clangTidyNotes -gt 0 ]; then echo "
:pencil2: Clang-Tidy found :pencil2: $clangTidyNotes notes" >> ${{ env.logdir }}checkReport.md else echo "
:heavy_check_mark: Clang-Tidy found no errors, warnings or notes" >> ${{ env.logdir }}checkReport.md fi + echo "" >> ${{ env.logdir }}checkReport.md + # enabled checks + echo "
:information_source: Enabled checks" >> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}clang-tidy.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}clang-tidy-enabled-checks.log >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + echo "
">> ${{ env.logdir }}checkReport.md + echo "" >> ${{ env.logdir }}checkReport.md + echo '```' >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}clang-tidy.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md # Error the step if pylint has found errors - if [ "$clangTidyErrors" -gt 0 ] && [ ${{ env.clangTidyFailSilent }} != true ]; then + if [ $clangTidyErrors -gt 0 ] && [ ${{ env.clangTidyFailSilent }} != true ]; then exit 1 else + echo "Clang-tidy exited with code $exitCode, but we are ignoring it" exit 0 fi @@ -656,7 +969,7 @@ jobs: clazyWarnings="0" clazyNotes="0" - sudo apt-get install clazy + sudo apt-get install -y --no-install-recommends clazy clazy-standalone --export-fixes=${{ env.fixesdir }}clazy.yaml -checks=${{ env.clazyChecks }} -p build/ ${{ steps.files-by-extensions.outputs.cpp_files }} &>> ${{ env.logdir }}clazy.log || true @@ -688,10 +1001,11 @@ jobs: else echo "
:heavy_check_mark: Clazy found no errors, warnings or notes" >> ${{ env.logdir }}checkReport.md fi - echo "" >> ${{ env.logdir }}checkReport.md + # documentation link + echo "[List of checks](https://github.com/KDE/clazy#list-of-checks), [This explains some of the clazy warnings](https://www.kdab.com/uncovering-32-qt-best-practices-compile-time-clazy/) " >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}clazy.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}clazy.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md @@ -705,7 +1019,7 @@ jobs: - name: Clazy-QT6 shell: bash - if: env.checkClazyQT6 == 'true' && steps.files-by-extensions.outputs.cpp_files != '' && github.base_ref == env.QT6Branch && always() + if: env.checkClazyQT6 == 'true' && steps.files-by-extensions.outputs.cpp_files != '' && github.ref == env.QT6Branch && always() run: | clazyQT6Errors="0" clazyQT6Warnings="0" @@ -748,7 +1062,7 @@ jobs: echo "" >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md - head -n 500 ${{ env.logdir }}clazyQT6.log >> ${{ env.logdir }}checkReport.md + cat ${{ env.logdir }}clazyQT6.log >> ${{ env.logdir }}checkReport.md echo '```' >> ${{ env.logdir }}checkReport.md echo "
">> ${{ env.logdir }}checkReport.md echo "" >> ${{ env.logdir }}checkReport.md @@ -791,8 +1105,24 @@ jobs: cat ${{ env.logdir }}checkReport.md > $GITHUB_STEP_SUMMARY - name: Create Pull request comment - if: env.reportPRComment == 'true' && always() + if: env.reportPRComment == 'true' && github.event_name == 'pull_request' && always() uses: marocchino/sticky-pull-request-comment@v2 with: header: Check results path: ${{ env.logdir }}checkReport.md + + - name: get comment body + id: get-comment-body + if: env.reportPushComment == 'true' && github.event_name == 'push' && always() + run: | + body=$(cat ${{ env.logdir }}checkReport.md) + body="${body//'%'/'%25'}" + body="${body//$'\n'/'%0A'}" + body="${body//$'\r'/'%0D'}" + echo ::set-output name=body::$body + + - name: Create commit comment + if: env.reportPushComment == 'true' && github.event_name == 'push' && always() + uses: peter-evans/commit-comment@v2 + with: + body: ${{ steps.get-comment-body.outputs.body }} diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml deleted file mode 100644 index f6f3b112af..0000000000 --- a/.github/workflows/codespell.yml +++ /dev/null @@ -1,31 +0,0 @@ -# GitHub Action to automate the identification of common misspellings in text files. -# https://github.com/codespell-project/actions-codespell -# https://github.com/codespell-project/codespell - -name: Codespell -on: - pull_request: - -jobs: - codespell: - name: Check for spelling errors - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v12.2 - - - name: List all changed files - run: | - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - echo "$file was changed" - done - - - uses: codespell-project/actions-codespell@master - with: - check_filenames: true - ignore_words_file: .github/codespellignore - skip: ./.git,*.po,*.ts,*.svg,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/ - path: ${{ steps.changed-files.outputs.all_changed_files }} \ No newline at end of file diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000000..e1669ef067 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,614 @@ +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist= + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold to be exceeded before program exits with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the ignore-list. The +# regex matches against paths and can be in Posix or Windows format. +ignore-paths= + +# Files or directories matching the regex patterns are skipped. The regex +# matches against base names, not paths. The default value ignores Emacs file +# locks +ignore-patterns=^\.# + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs=1 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.10 + +# Discover python modules and packages in the file system subtree. +recursive=no + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=yes + +# Activate the evaluation score. +score=yes + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=raw-checker-failed, + bad-inline-option, + locally-disabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + use-symbolic-message-instead, + invalid-name, + wrong-import-order, + import-error, + undefined-variable + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable=c-extension-no-member + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +#argument-rgx= + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +#class-attribute-rgx= + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _ + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +#variable-rgx= + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=cls + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error + + +[DESIGN] + +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= + +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=12 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=BaseException, + Exception + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[SIMILARITIES] + +# Comments are removed from the similarity computation +ignore-comments=yes + +# Docstrings are removed from the similarity computation +ignore-docstrings=yes + +# Imports are removed from the similarity computation +ignore-imports=yes + +# Signatures are removed from the similarity computation +ignore-signatures=yes + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it work, +# install the 'python-enchant' package. +spelling-dict= + +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io