clang-tidy:添加。
This commit is contained in:
		
							parent
							
								
									64c9588315
								
							
						
					
					
						commit
						a7c61f6ea2
					
				
							
								
								
									
										136
									
								
								.clang-tidy
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										136
									
								
								.clang-tidy
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,136 @@
 | 
				
			|||||||
 | 
					Checks: '-*,
 | 
				
			||||||
 | 
					  clang-*,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  google-build-explicit-make-pair,
 | 
				
			||||||
 | 
					  google-build-namespaces,
 | 
				
			||||||
 | 
					  google-default-arguments,
 | 
				
			||||||
 | 
					  google-explicit-constructor,
 | 
				
			||||||
 | 
					  google-readability-avoid-underscore-in-googletest-name,
 | 
				
			||||||
 | 
					  google-runtime-int,
 | 
				
			||||||
 | 
					  google-runtime-operator,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  readability-non-const-parameter,
 | 
				
			||||||
 | 
					  readability-avoid-const-params-in-decls,
 | 
				
			||||||
 | 
					  readability-const-return-type,
 | 
				
			||||||
 | 
					  readability-container-size-empty,
 | 
				
			||||||
 | 
					  readability-convert-member-functions-to-static,
 | 
				
			||||||
 | 
					  readability-delete-null-pointer,
 | 
				
			||||||
 | 
					  readability-deleted-default,
 | 
				
			||||||
 | 
					  readability-make-member-function-const,
 | 
				
			||||||
 | 
					  readability-misplaced-array-index,
 | 
				
			||||||
 | 
					  readability-qualified-auto,
 | 
				
			||||||
 | 
					  readability-redundant-control-flow,
 | 
				
			||||||
 | 
					  readability-redundant-function-ptr-dereference,
 | 
				
			||||||
 | 
					  readability-redundant-smartptr-get,
 | 
				
			||||||
 | 
					  readability-redundant-string-cstr,
 | 
				
			||||||
 | 
					  readability-static-definition-in-anonymous-namespace,
 | 
				
			||||||
 | 
					  readability-string-compare,
 | 
				
			||||||
 | 
					  readability-uniqueptr-delete-release,
 | 
				
			||||||
 | 
					  readability-redundant-member-init,
 | 
				
			||||||
 | 
					  readability-simplify-subscript-expr,
 | 
				
			||||||
 | 
					  readability-simplify-boolean-expr,
 | 
				
			||||||
 | 
					  readability-inconsistent-declaration-parameter-name,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  cert-dcl21-cpp,
 | 
				
			||||||
 | 
					  cert-dcl50-cpp,
 | 
				
			||||||
 | 
					  cert-env33-c,
 | 
				
			||||||
 | 
					  cert-err34-c,
 | 
				
			||||||
 | 
					  cert-err52-cpp,
 | 
				
			||||||
 | 
					  cert-flp30-c,
 | 
				
			||||||
 | 
					  cert-mem57-cpp,
 | 
				
			||||||
 | 
					  cert-msc50-cpp,
 | 
				
			||||||
 | 
					  cert-oop58-cpp,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  modernize-avoid-bind,
 | 
				
			||||||
 | 
					  modernize-deprecated-headers,
 | 
				
			||||||
 | 
					  modernize-loop-convert,
 | 
				
			||||||
 | 
					  modernize-make-shared,
 | 
				
			||||||
 | 
					  modernize-make-unique,
 | 
				
			||||||
 | 
					  modernize-pass-by-value,
 | 
				
			||||||
 | 
					  modernize-raw-string-literal,
 | 
				
			||||||
 | 
					  modernize-redundant-void-arg,
 | 
				
			||||||
 | 
					  modernize-replace-auto-ptr,
 | 
				
			||||||
 | 
					  modernize-shrink-to-fit,
 | 
				
			||||||
 | 
					  modernize-use-bool-literals,
 | 
				
			||||||
 | 
					  modernize-use-emplace,
 | 
				
			||||||
 | 
					  modernize-use-equals-delete,
 | 
				
			||||||
 | 
					  modernize-use-nullptr,
 | 
				
			||||||
 | 
					  modernize-use-override,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  cppcoreguidelines-pro-type-reinterpret-cast,
 | 
				
			||||||
 | 
					  -cppcoreguidelines-narrowing-conversions,
 | 
				
			||||||
 | 
					  cppcoreguidelines-pro-type-member-init,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  misc-unconventional-assign-operator,
 | 
				
			||||||
 | 
					  -misc-unused-parameters,
 | 
				
			||||||
 | 
					  misc-throw-by-value-catch-by-reference,
 | 
				
			||||||
 | 
					  misc-misplaced-const,
 | 
				
			||||||
 | 
					  misc-redundant-expression,
 | 
				
			||||||
 | 
					  misc-static-assert,
 | 
				
			||||||
 | 
					  misc-uniqueptr-reset-release,
 | 
				
			||||||
 | 
					  -misc-unused-alias-decls,
 | 
				
			||||||
 | 
					  -misc-unused-using-decls,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bugprone-undelegated-constructor,
 | 
				
			||||||
 | 
					  bugprone-macro-parentheses,
 | 
				
			||||||
 | 
					  bugprone-macro-repeated-side-effects,
 | 
				
			||||||
 | 
					  bugprone-forward-declaration-namespace,
 | 
				
			||||||
 | 
					  bugprone-bool-pointer-implicit-conversion,
 | 
				
			||||||
 | 
					  bugprone-misplaced-widening-cast,
 | 
				
			||||||
 | 
					  bugprone-argument-comment,
 | 
				
			||||||
 | 
					  bugprone-bad-signal-to-kill-thread,
 | 
				
			||||||
 | 
					  bugprone-copy-constructor-init,
 | 
				
			||||||
 | 
					  bugprone-dangling-handle,
 | 
				
			||||||
 | 
					  bugprone-fold-init-type,
 | 
				
			||||||
 | 
					  bugprone-inaccurate-erase,
 | 
				
			||||||
 | 
					  bugprone-incorrect-roundings,
 | 
				
			||||||
 | 
					  bugprone-integer-division,
 | 
				
			||||||
 | 
					  bugprone-misplaced-operator-in-strlen-in-alloc,
 | 
				
			||||||
 | 
					  bugprone-misplaced-pointer-arithmetic-in-alloc,
 | 
				
			||||||
 | 
					  bugprone-move-forwarding-reference,
 | 
				
			||||||
 | 
					  bugprone-multiple-statement-macro,
 | 
				
			||||||
 | 
					  bugprone-parent-virtual-call,
 | 
				
			||||||
 | 
					  bugprone-posix-return,
 | 
				
			||||||
 | 
					  bugprone-reserved-identifier,
 | 
				
			||||||
 | 
					  bugprone-signed-char-misuse,
 | 
				
			||||||
 | 
					  bugprone-sizeof-container,
 | 
				
			||||||
 | 
					  bugprone-sizeof-expression,
 | 
				
			||||||
 | 
					  bugprone-string-constructor,
 | 
				
			||||||
 | 
					  bugprone-string-integer-assignment,
 | 
				
			||||||
 | 
					  bugprone-string-literal-with-embedded-nul,
 | 
				
			||||||
 | 
					  bugprone-suspicious-enum-usage,
 | 
				
			||||||
 | 
					  bugprone-suspicious-include,
 | 
				
			||||||
 | 
					  bugprone-suspicious-memset-usage,
 | 
				
			||||||
 | 
					  bugprone-suspicious-missing-comma,
 | 
				
			||||||
 | 
					  bugprone-suspicious-string-compare,
 | 
				
			||||||
 | 
					  bugprone-swapped-arguments,
 | 
				
			||||||
 | 
					  bugprone-terminating-continue,
 | 
				
			||||||
 | 
					  bugprone-throw-keyword-missing,
 | 
				
			||||||
 | 
					  bugprone-too-small-loop-variable,
 | 
				
			||||||
 | 
					  bugprone-undefined-memory-manipulation,
 | 
				
			||||||
 | 
					  bugprone-unhandled-self-assignment,
 | 
				
			||||||
 | 
					  bugprone-unused-raii,
 | 
				
			||||||
 | 
					  bugprone-unused-return-value,
 | 
				
			||||||
 | 
					  bugprone-use-after-move,
 | 
				
			||||||
 | 
					  bugprone-virtual-near-miss,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  hicpp-exception-baseclass,
 | 
				
			||||||
 | 
					  hicpp-ignored-remove-result,
 | 
				
			||||||
 | 
					  hicpp-no-assembler,
 | 
				
			||||||
 | 
					  hicpp-signed-bitwise,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  performance-faster-string-find,
 | 
				
			||||||
 | 
					  performance-for-range-copy,
 | 
				
			||||||
 | 
					  performance-implicit-conversion-in-loop,
 | 
				
			||||||
 | 
					  performance-inefficient-algorithm,
 | 
				
			||||||
 | 
					  performance-inefficient-vector-operation,
 | 
				
			||||||
 | 
					  performance-move-constructor-init,
 | 
				
			||||||
 | 
					  performance-no-automatic-move,
 | 
				
			||||||
 | 
					  performance-trivially-destructible,
 | 
				
			||||||
 | 
					  performance-unnecessary-copy-initialization,
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  boost-use-to-string,
 | 
				
			||||||
 | 
					  boost-use-ranges,
 | 
				
			||||||
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WarningsAsErrors: '*'
 | 
				
			||||||
							
								
								
									
										15
									
								
								.clangd
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								.clangd
									
									
									
									
									
								
							@ -1,12 +1,9 @@
 | 
				
			|||||||
Hover:
 | 
					Hover:
 | 
				
			||||||
    ShowAKA: Yes
 | 
					  ShowAKA: true
 | 
				
			||||||
Diagnostics:
 | 
					Diagnostics:
 | 
				
			||||||
  UnusedIncludes: None        # 禁用未使用头文件提示
 | 
					  UnusedIncludes: None        # 禁用未使用头文件提示
 | 
				
			||||||
    Suppress: [
 | 
					  Suppress: 
 | 
				
			||||||
        anon_type_definition,   # 禁用匿名的typedef提示
 | 
					    - anon_type_definition   # 禁用匿名的typedef提示
 | 
				
			||||||
        unused-variable,        # 禁用未使用变量提示
 | 
					    - unused-variable        # 禁用未使用变量提示
 | 
				
			||||||
        unused-function,        # 禁用未使用函数提示
 | 
					    - unused-function        # 禁用未使用函数提示
 | 
				
			||||||
        unused-includes,        # 禁用未使用的头文件提示
 | 
					    - unused-includes        # 禁用未使用的头文件提示
 | 
				
			||||||
    ]
 | 
					 | 
				
			||||||
    ClangTidy:
 | 
					 | 
				
			||||||
        Remove: misc-unused-alias-decls
 | 
					 | 
				
			||||||
							
								
								
									
										1
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@ -38,7 +38,6 @@
 | 
				
			|||||||
        "--header-insertion=never",
 | 
					        "--header-insertion=never",
 | 
				
			||||||
        "--all-scopes-completion",
 | 
					        "--all-scopes-completion",
 | 
				
			||||||
        "--completion-style=detailed",
 | 
					        "--completion-style=detailed",
 | 
				
			||||||
        "--clang-tidy",
 | 
					 | 
				
			||||||
        "-j=4",
 | 
					        "-j=4",
 | 
				
			||||||
        "--pch-storage=memory",
 | 
					        "--pch-storage=memory",
 | 
				
			||||||
        "--compile-commands-dir=build",
 | 
					        "--compile-commands-dir=build",
 | 
				
			||||||
 | 
				
			|||||||
@ -7,6 +7,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "../openaiclient.h"
 | 
					#include "../openaiclient.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static std::shared_ptr<OpenAIClient> gc = nullptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CApiDllExport
 | 
					class CApiDllExport
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
@ -41,7 +43,6 @@ void CApiDllExport::init_exchange(ExchangeData* ex)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void init_api(const char* ip, unsigned int port)
 | 
					void init_api(const char* ip, unsigned int port)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ExchangeData* ask_openai(const char* content)
 | 
					ExchangeData* ask_openai(const char* content)
 | 
				
			||||||
 | 
				
			|||||||
@ -25,7 +25,7 @@ struct FrameData {
 | 
				
			|||||||
        len = 0;
 | 
					        len = 0;
 | 
				
			||||||
        delete[] data;
 | 
					        delete[] data;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    FrameType type;
 | 
					    FrameType type{};
 | 
				
			||||||
    char* data{};
 | 
					    char* data{};
 | 
				
			||||||
    int len{};
 | 
					    int len{};
 | 
				
			||||||
    int16_t protk{};
 | 
					    int16_t protk{};
 | 
				
			||||||
 | 
				
			|||||||
@ -32,9 +32,9 @@ public:
 | 
				
			|||||||
    static std::string trim(const std::string& input);
 | 
					    static std::string trim(const std::string& input);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    std::string user_{};
 | 
					    std::string user_;
 | 
				
			||||||
    std::string model_{};
 | 
					    std::string model_;
 | 
				
			||||||
    std::string assistant_{};
 | 
					    std::string assistant_;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user