From b8f28d034852ff7a1d28cce0438381ff8202090e Mon Sep 17 00:00:00 2001 From: GinShio Date: Sun, 12 Feb 2023 23:32:05 +0800 Subject: [PATCH 1/5] Add basic configuration for project --- .clang-format | 1 + .clang-tidy | 102 +++++++ .editorconfig | 28 ++ .gitattributes | 40 +++ .gitignore | 667 ++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 10 + LICENSE | 24 ++ README.md | 22 ++ cmake/.gitkeep | 0 inc/.gitkeep | 0 src/CMakeLists.txt | 0 test/CMakeLists.txt | 0 12 files changed, 894 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-tidy create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 LICENSE create mode 100644 README.md create mode 100644 cmake/.gitkeep create mode 100644 inc/.gitkeep create mode 100644 src/CMakeLists.txt create mode 100644 test/CMakeLists.txt diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..9b3aa8b --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: LLVM diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..5175d6b --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,102 @@ +# check options see https://clang.llvm.org/extra/clang-tidy/checks/list.html + +Checks: -*, + boost-*, + cert-*, + -cert-env33-c, + -cert-msc50-cpp, + -cert-err58-cpp, + google-*, + -google-objc-*, + -google-readability-avoid-underscore-in-googletest-name, + -google-runtime-references, + -google-upgrade-googletest-case, + misc-*, + -misc-no-recursion, + -misc-non-private-member-variables-in-classes, + modernize-*, + -modernize-avoid-c-arrays, + -modernize-concat-nested-namespaces, + -modernize-deprecated-headers, + -modernize-use-nodiscard, + performance-*, + readability-*, + -readability-convert-member-functions-to-static, + -readability-inconsistent-declaration-parameter-name, + -readability-magic-numbers, + -readability-suspicious-call-argument, + -readability-uppercase-literal-suffix, + +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: none + +CheckOptions: + - key: google-build-namespaces.HeaderFileExtensions + value: 'h,hh,hpp,hxx,' + - key: google-global-names-in-headers.HeaderFileExtensions + value: 'h,hh,hpp,hxx,' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: 'true' + - key: misc-uniqueptr-reset-release.IncludeStyle + value: llvm + - key: modernize-loop-convert.MaxCopySize + value: '8' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: modernize-use-emplace.IgnoreImplicitConstructors + value: 'true' + - key: modernize-use-override.IgnoreDestructors + value: 'true' + # SEE: https://clang.llvm.org/extra/clang-tidy/checks/readability-function-cognitive-complexity.html + - key: readability-function-cognitive-complexity.Threshold + value: '25' + - key: readability-function-size.LineThreshold + value: '64' + - key: readability-function-size.StatementThreshold + value: '500' + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.ClassMemberCase + value: lower_case + - key: readability-identifier-naming.ClassMemberSuffix + value: _ + - key: readability-identifier-naming.ConstantCase + value: CamelCase + - key: readability-identifier-naming.ConstantPrefix + value: k + - key: readability-identifier-naming.EnumCase + value: CamelCase + - key: readability-identifier-naming.EnumConstantCase + value: CamelCase + - key: readability-identifier-naming.EnumConstantPrefix + value: k + - key: readability-identifier-naming.FunctionCase + value: lower_case + - key: readability-identifier-naming.MacroDefinitionCase + value: UPPER_CASE + - key: readability-identifier-naming.PrivateMemberSuffix + value: _ + - key: readability-identifier-naming.ProtectedMemberSuffix + value: _ + - key: readability-identifier-naming.StructCase + value: CamelCase + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.TemplateParameterCase + value: CamelCase + - key: readability-identifier-naming.TypeTemplateParameterIgnoredRegexp + value: expr-type + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: 'true' + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: 'true' diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6a7615c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,28 @@ +root = true + +[*] +charset = utf-8 +curly_bracket_next_line = false +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 80 +quote_type = double +spaces_around_operators = true +tab_width = 4 +trim_trailing_whitespace = true + +[*.sh] +indent_size = 4 +max_line_length = 120 + +[*.{c,h}] +indent_size = 8 + +[Makefile] +indent_style = tab +max_line_length = 120 + +[*.{sln,vcxproj,vcproj,xproj,props,vcxitems}] +end_of_line = crlf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..524757e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,40 @@ +######################### C ######################### +*.c text eol=lf diff=c encoding +*.h text eol=lf diff=c encoding + + +######################### C++ ######################### +*.cc text eol=lf diff=cpp encoding +*.cxx text eol=lf diff=cpp encoding +*.cpp text eol=lf diff=cpp encoding +*.c++ text eol=lf diff=cpp encoding +*.hh text eol=lf diff=cpp encoding +*.hxx test eol=lf diff=cpp encoding +*.hpp text eol=lf diff=cpp encoding +*.h++ text eol=lf diff=cpp encoding +*.tcc text eol=lf diff=cpp encoding + + +######################### CMake ######################### +*.cmake text eol=lf encoding +CMakeLists.txt text eol=lf encoding + + +######################### VisualStudio ######################### +*.sln text eol=crlf +*.csproj text eol=crlf +*.vbproj text eol=crlf +*.vcxproj text eol=crlf +*.vcproj text eol=crlf +*.dbproj text eol=crlf +*.fsproj text eol=crlf +*.lsproj text eol=crlf +*.wixproj text eol=crlf +*.modelproj text eol=crlf +*.sqlproj text eol=crlf +*.wwaproj text eol=crlf + +*.xproj text eol=crlf +*.props text eol=crlf +*.filters text eol=crlf +*.vcxitems text eol=crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed3cce7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,667 @@ +######################### C++ ######################### +# repo: github/gitignore; pin: 2c52d023dd; file: C++.gitignore +# LICENSE: Creative Commons Zero v1.0 Universal +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + + +######################### CMake ######################### +# repo: github/gitignore; pin: f273474b97; file: CMake.gitignore +# LICENSE: Creative Commons Zero v1.0 Universal +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps + + +######################### Emacs ######################### +# repo: github/gitignore; pin: 87ec1bd864; file: Global/Emacs.gitignore +# LICENSE: Creative Commons Zero v1.0 Universal +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +######################### Vim ######################### +# repo: github/gitignore; pin: 41ec05833a; file: Global/Vim.gitignore +# LICENSE: Creative Commons Zero v1.0 Universal +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + + +######################### VisualStudioCode ######################### +# repo: github/gitignore; pin: bf3f140cfa; file: Global/VisualStudioCode.gitignore +# LICENSE: Creative Commons Zero v1.0 Universal +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + + +######################### JetBrains ######################### +# repo: github/gitignore; pin: cdde85a36e; file: Global/JetBrains.gitignore +# LICENSE: Creative Commons Zero v1.0 Universal +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + + +######################### VisualStudio ######################### +# repo: github/gitignore; pin: 491040e88a; file: Global/VisualStudio.gitignore +# LICENSE: Creative Commons Zero v1.0 Universal +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + + +######################### Archives ######################### +# repo: github/gitignore; pin: 3794768510; file: Global/Archives.gitignore +# LICENSE: Creative Commons Zero v1.0 Universal +# It's better to unpack these files and commit the raw source because +# git has its own built in compression methods. +*.7z +*.jar +*.rar +*.zip +*.gz +*.gzip +*.tgz +*.bzip +*.bzip2 +*.bz2 +*.xz +*.lzma +*.cab +*.xar + +# Packing-only formats +*.iso +*.tar + +# Package management formats +*.dmg +*.xpi +*.gem +*.egg +*.deb +*.rpm +*.msi +*.msm +*.msp +*.txz diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..42d7ab3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.11 FATAL_ERROR) + +project(ywl-scheme + LANGUAGES CXX + VERSION 0.1) + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + +add_subdirectory(src) +add_subdirectory(test) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e0c9a1e --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2023 Nautilus-YWL + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c506da1 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# YWL Scheme + +## 下载及编译 + + - 下载 +``` shell +git clone git@github.com:Nautilus-YWL/gittemplate.git ywl-gittemplate +git clone git@github.com:Nautilus-YWL/YWLScheme.git \ + --template=ywl-gittemplate +``` + + - 编译 + +``` shell +cmake -S. -Bcmake-build-debug -GNinja +``` + +## 协议 + +Copyright (c) 2023 Nautilus-YWL + +[LICENSE](LICENSE) at The 2-Clause BSD diff --git a/cmake/.gitkeep b/cmake/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/inc/.gitkeep b/inc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..e69de29 From 64ff133455e7c7fc82bfab41b364d4e29f23bb97 Mon Sep 17 00:00:00 2001 From: GinShio Date: Thu, 16 Feb 2023 01:52:57 +0800 Subject: [PATCH 2/5] add rules for formatter --- .clang-format | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.clang-format b/.clang-format index 9b3aa8b..d691e00 100644 --- a/.clang-format +++ b/.clang-format @@ -1 +1,31 @@ +--- BasedOnStyle: LLVM +AccessModifierOffset: -1 +AlignArrayOfStructures: Right +AlwaysBreakTemplateDeclarations: Yes +BreakConstructorInitializers: BeforeColon +BreakConstructorInitializersBeforeComma: true +BreakInheritanceList: BeforeComma +BreakBeforeInheritanceComma: true +EmptyLineBeforeAccessModifier: Always +IncludeBlocks: Regroup +IndentCaseLabels: true +InsertBraces: true +InsertNewlineAtEOF: true +IntegerLiteralSeparator: + Binary: 4 + Decimal: 3 + Hex: 2 +KeepEmptyLinesAtTheStartOfBlocks: false +LineEnding: LF +PointerAlignment: Left +QualifierAlignment: Custom +QualifierOrder: ['inline', 'static', 'constexpr', 'type', 'const', 'volatile'] +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +ShortNamespaceLines: 8 +SpacesBeforeTrailingComments: 2 +UseCRLF: false +UseTab: Never +DisableFormat: true +... From 9567c15de0c2c53311661b436ee4e4c09e4bf0c9 Mon Sep 17 00:00:00 2001 From: GinShio Date: Thu, 16 Feb 2023 03:21:50 +0800 Subject: [PATCH 3/5] add rules for linter --- .clang-tidy | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 5175d6b..b4884bf 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,10 +2,19 @@ Checks: -*, boost-*, + bugprone-*, + -bugprone-argument-comment, + -bugprone-easily-swappable-parameters, + -bugprone-exception-escape, + -bugprone-parent-virtual-call, + -bugprone-swapped-arguments, + -bugprone-unsafe-functions, cert-*, - -cert-env33-c, -cert-msc50-cpp, -cert-err58-cpp, + clang-analyzer-core.DynamicTypePropagation, + clang-analyzer-cplusplus.InnerPointer, + clang-analyzer-optin.performance.*, google-*, -google-objc-*, -google-readability-avoid-underscore-in-googletest-name, @@ -22,6 +31,7 @@ Checks: -*, performance-*, readability-*, -readability-convert-member-functions-to-static, + -readability-identifier-length, -readability-inconsistent-declaration-parameter-name, -readability-magic-numbers, -readability-suspicious-call-argument, @@ -33,6 +43,8 @@ AnalyzeTemporaryDtors: false FormatStyle: none CheckOptions: + - key: bugprone-suspicious-include.HeaderFileExtensions + value: ';h;hh;hpp;hxx;tcc;inc;def' - key: google-build-namespaces.HeaderFileExtensions value: 'h,hh,hpp,hxx,' - key: google-global-names-in-headers.HeaderFileExtensions @@ -40,7 +52,7 @@ CheckOptions: - key: google-readability-namespace-comments.SpacesBeforeComments value: '2' - key: google-readability-namespace-comments.ShortNamespaceLines - value: '10' + value: '8' - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic value: 'true' - key: misc-uniqueptr-reset-release.IncludeStyle From dcbfed88abbe57c8fa522b104d562df52995b0f8 Mon Sep 17 00:00:00 2001 From: GinShio Date: Sat, 18 Feb 2023 01:04:45 +0800 Subject: [PATCH 4/5] rename project name to nautilus --- .editorconfig | 3 +++ CMakeLists.txt | 2 +- README.md | 17 +---------------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6a7615c..90b5f21 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,3 +26,6 @@ max_line_length = 120 [*.{sln,vcxproj,vcproj,xproj,props,vcxitems}] end_of_line = crlf + +[*.md] +trim_trailing_whitespace = false diff --git a/CMakeLists.txt b/CMakeLists.txt index 42d7ab3..be4d08f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.11 FATAL_ERROR) -project(ywl-scheme +project(nautilus LANGUAGES CXX VERSION 0.1) diff --git a/README.md b/README.md index c506da1..6738f69 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,4 @@ -# YWL Scheme - -## 下载及编译 - - - 下载 -``` shell -git clone git@github.com:Nautilus-YWL/gittemplate.git ywl-gittemplate -git clone git@github.com:Nautilus-YWL/YWLScheme.git \ - --template=ywl-gittemplate -``` - - - 编译 - -``` shell -cmake -S. -Bcmake-build-debug -GNinja -``` +# Nautilus Scheme ## 协议 From 166d114767933cdb680f05cf3d549aec95ab78f5 Mon Sep 17 00:00:00 2001 From: GinShio Date: Sun, 19 Feb 2023 22:27:56 +0800 Subject: [PATCH 5/5] add rules for linter --- .clang-tidy | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index b4884bf..3ef51f2 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -12,9 +12,17 @@ Checks: -*, cert-*, -cert-msc50-cpp, -cert-err58-cpp, - clang-analyzer-core.DynamicTypePropagation, - clang-analyzer-cplusplus.InnerPointer, + clang-analyzer-core.*, + clang-analyzer-cplusplus.*, + clang-analyzer-optin.cplusplus.*, clang-analyzer-optin.performance.*, + clang-analyzer-unix.*, + clang-analyzer-valist.*, + cppcoreguidelines-avoid-capture-default-when-capturing-this, + cppcoreguidelines-prefer-member-initializer, + cppcoreguidelines-slicing, + cppcoreguidelines-special-member-functions, + cppcoreguidelines-virtual-class-destructor, google-*, -google-objc-*, -google-readability-avoid-underscore-in-googletest-name, @@ -31,7 +39,6 @@ Checks: -*, performance-*, readability-*, -readability-convert-member-functions-to-static, - -readability-identifier-length, -readability-inconsistent-declaration-parameter-name, -readability-magic-numbers, -readability-suspicious-call-argument, @@ -46,9 +53,9 @@ CheckOptions: - key: bugprone-suspicious-include.HeaderFileExtensions value: ';h;hh;hpp;hxx;tcc;inc;def' - key: google-build-namespaces.HeaderFileExtensions - value: 'h,hh,hpp,hxx,' + value: 'h,hh,hpp,hxx,tcc,' - key: google-global-names-in-headers.HeaderFileExtensions - value: 'h,hh,hpp,hxx,' + value: 'h,hh,hpp,hxx,tcc,' - key: google-readability-namespace-comments.SpacesBeforeComments value: '2' - key: google-readability-namespace-comments.ShortNamespaceLines @@ -76,6 +83,10 @@ CheckOptions: value: '64' - key: readability-function-size.StatementThreshold value: '500' + - key: readability-identifier-length.MinimumVariableNameLength + value: '2' + - key: readability-identifier-length.MinimumParameterNameLength + value: '2' - key: readability-identifier-naming.ClassCase value: CamelCase - key: readability-identifier-naming.ClassMemberCase