mopr 0.0.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. mopr-0.0.10/.clang-format +99 -0
  2. mopr-0.0.10/.clang-tidy +147 -0
  3. mopr-0.0.10/.clangd +8 -0
  4. mopr-0.0.10/.editorconfig +34 -0
  5. mopr-0.0.10/.gitattributes +15 -0
  6. mopr-0.0.10/.gitignore +199 -0
  7. mopr-0.0.10/.vscode/launch.json +19 -0
  8. mopr-0.0.10/.vscode/settings.json +7 -0
  9. mopr-0.0.10/.vscode/tasks.json +55 -0
  10. mopr-0.0.10/AGENTS.md +89 -0
  11. mopr-0.0.10/BUILDING.md +235 -0
  12. mopr-0.0.10/CHANGELOG.md +162 -0
  13. mopr-0.0.10/CMakeLists.txt +78 -0
  14. mopr-0.0.10/CMakePresets.json +124 -0
  15. mopr-0.0.10/CONTRIBUTING.md +83 -0
  16. mopr-0.0.10/Cargo.toml +50 -0
  17. mopr-0.0.10/LICENSE +661 -0
  18. mopr-0.0.10/MANIFEST.in +46 -0
  19. mopr-0.0.10/PKG-INFO +669 -0
  20. mopr-0.0.10/README.md +122 -0
  21. mopr-0.0.10/conanfile.py +75 -0
  22. mopr-0.0.10/demo/keyboard-stats/.gitignore +4 -0
  23. mopr-0.0.10/demo/keyboard-stats/README.md +82 -0
  24. mopr-0.0.10/demo/keyboard-stats/index.html +12 -0
  25. mopr-0.0.10/demo/keyboard-stats/package.json +19 -0
  26. mopr-0.0.10/demo/keyboard-stats/src/App.vue +521 -0
  27. mopr-0.0.10/demo/keyboard-stats/src/composables/useKeyboardStats.js +269 -0
  28. mopr-0.0.10/demo/keyboard-stats/src/main.js +5 -0
  29. mopr-0.0.10/demo/keyboard-stats/src/style.css +21 -0
  30. mopr-0.0.10/demo/keyboard-stats/vite.config.js +10 -0
  31. mopr-0.0.10/distributed/__init__.py +4 -0
  32. mopr-0.0.10/distributed/id/FileStateStore.java +145 -0
  33. mopr-0.0.10/distributed/id/Generator.java +46 -0
  34. mopr-0.0.10/distributed/id/HLC.java +155 -0
  35. mopr-0.0.10/distributed/id/Id.java +78 -0
  36. mopr-0.0.10/distributed/id/Option.java +57 -0
  37. mopr-0.0.10/distributed/id/PersistentState.java +35 -0
  38. mopr-0.0.10/distributed/id/README.md +235 -0
  39. mopr-0.0.10/distributed/id/StateStore.java +10 -0
  40. mopr-0.0.10/distributed/id/__init__.py +48 -0
  41. mopr-0.0.10/distributed/id/generator.py +74 -0
  42. mopr-0.0.10/distributed/id/hlc.py +109 -0
  43. mopr-0.0.10/distributed/id/id.py +83 -0
  44. mopr-0.0.10/distributed/id/option.py +80 -0
  45. mopr-0.0.10/distributed/id/queue.py +125 -0
  46. mopr-0.0.10/distributed/id/state_store.py +435 -0
  47. mopr-0.0.10/distributed/id/tests.py +306 -0
  48. mopr-0.0.10/lib.rs +2 -0
  49. mopr-0.0.10/main.cpp +63 -0
  50. mopr-0.0.10/main.rs +3 -0
  51. mopr-0.0.10/mopr.egg-info/PKG-INFO +669 -0
  52. mopr-0.0.10/mopr.egg-info/SOURCES.txt +68 -0
  53. mopr-0.0.10/mopr.egg-info/dependency_links.txt +1 -0
  54. mopr-0.0.10/mopr.egg-info/scm_file_list.json +126 -0
  55. mopr-0.0.10/mopr.egg-info/scm_version.json +8 -0
  56. mopr-0.0.10/mopr.egg-info/top_level.txt +1 -0
  57. mopr-0.0.10/ninja-toolchain.cmake +8 -0
  58. mopr-0.0.10/publish.bat +62 -0
  59. mopr-0.0.10/publish.ps1 +118 -0
  60. mopr-0.0.10/publish.sh +71 -0
  61. mopr-0.0.10/pyproject.toml +31 -0
  62. mopr-0.0.10/python/__init__.py +5 -0
  63. mopr-0.0.10/python/_version.py +24 -0
  64. mopr-0.0.10/refresh-clangd.ps1 +47 -0
  65. mopr-0.0.10/runtime/__init__.py +1 -0
  66. mopr-0.0.10/runtime/ringbuffer.md +179 -0
  67. mopr-0.0.10/runtime/ringbuffer.py +210 -0
  68. mopr-0.0.10/runtime/ringbuffer_test.py +81 -0
  69. mopr-0.0.10/rust-toolchain.toml +11 -0
  70. mopr-0.0.10/setup.cfg +4 -0
@@ -0,0 +1,99 @@
1
+ BasedOnStyle: Google
2
+ AccessModifierOffset: -4
3
+ AlignAfterOpenBracket: Align
4
+ AlignConsecutiveAssignments: true
5
+ AlignConsecutiveDeclarations: true
6
+ AlignEscapedNewlines: Left
7
+ AlignOperands: true
8
+ AlignTrailingComments: true
9
+ AllowAllArgumentsOnNextLine: true
10
+ AllowAllParametersOfDeclarationOnNextLine: true
11
+ AllowShortBlocksOnASingleLine: false
12
+ AllowShortCaseLabelsOnASingleLine: false
13
+ AllowShortFunctionsOnASingleLine: InlineOnly
14
+ AllowShortIfStatementsOnASingleLine: false
15
+ AllowShortLoopsOnASingleLine: false
16
+ AlwaysBreakAfterDefinitionReturnType: None
17
+ AlwaysBreakAfterReturnType: None
18
+ AlwaysBreakBeforeMultilineStrings: false
19
+ AlwaysBreakTemplateDeclarations: Yes
20
+ BinPackArguments: false
21
+ BinPackParameters: false
22
+ BraceWrapping:
23
+ AfterClass: true
24
+ AfterControlStatement: Never
25
+ AfterEnum: true
26
+ AfterFunction: true
27
+ AfterNamespace: false
28
+ AfterObjCDeclaration: false
29
+ AfterStruct: true
30
+ AfterUnion: true
31
+ BeforeElse: true
32
+ IndentBraces: false
33
+ SplitEmptyFunction: true
34
+ SplitEmptyRecord: true
35
+ SplitEmptyNamespace: true
36
+ BreakBeforeBinaryOperators: None
37
+ BreakBeforeTernaryOperators: true
38
+ BreakConstructorInitializers: BeforeComma
39
+ ColumnLimit: 120
40
+ CommentPragmas: '^ IWYU pragma:'
41
+ CompactNamespaces: false
42
+ ConstructorInitializerIndentWidth: 4
43
+ ContinuationIndentWidth: 4
44
+ Cpp11BracedListStyle: true
45
+ DerivePointerAlignment: false
46
+ DisableFormat: false
47
+ ExperimentalAutoDetectBinPacking: false
48
+ FixNamespaceComments: true
49
+ ForEachMacros:
50
+ - foreach
51
+ - qForeach
52
+ IncludeCategories:
53
+ - Regex: '^<.*\.h>'
54
+ Priority: 1
55
+ - Regex: '^<.*'
56
+ Priority: 2
57
+ - Regex: '.*'
58
+ Priority: 3
59
+ IncludeIsMainRegex: '(test|main)\.cpp'
60
+ IndentCaseLabels: true
61
+ IndentWidth: 4
62
+ IndentWrappedFunctionNames: false
63
+ JavaScriptQuotes: Leave
64
+ #JavaScriptRegExp: false
65
+ KeepEmptyLinesAtTheStartOfBlocks: true
66
+ MacroBlockBegin: ''
67
+ MacroBlockEnd: ''
68
+ MaxEmptyLinesToKeep: 1
69
+ NamespaceIndentation: All # namespace 内部内容也缩进
70
+ PenaltyBreakAssignment: 40
71
+ PenaltyBreakBeforeFirstCallParameter: 19
72
+ PenaltyBreakComment: 300
73
+ PenaltyBreakFirstLessLess: 120
74
+ PenaltyBreakString: 1000
75
+ PenaltyExcessCharacter: 1000000
76
+ PenaltyReturnTypeOnItsOwnLine: 60
77
+ PointerAlignment: Right
78
+ ReflowComments: true
79
+ SortIncludes: true
80
+ SortUsingDeclarations: true
81
+ SpaceAfterCStyleCast: false
82
+ SpaceAfterLogicalNot: false
83
+ SpaceAfterTemplateKeyword: true
84
+ SpaceBeforeAssignmentOperators: true
85
+ SpaceBeforeCpp11BracedList: false
86
+ #SpaceBeforeCtorColon: true
87
+ SpaceBeforeInheritanceColon: true
88
+ SpaceBeforeParens: ControlStatements
89
+ SpaceBeforeRangeBasedForLoopColon: true
90
+ SpaceInEmptyParentheses: false
91
+ SpacesBeforeTrailingComments: 2
92
+ SpacesInAngles: false
93
+ SpacesInContainerLiterals: false
94
+ SpacesInCStyleCastParentheses: false
95
+ SpacesInParentheses: false
96
+ SpacesInSquareBrackets: false
97
+ Standard: c++20
98
+ TabWidth: 4
99
+ UseTab: Never
@@ -0,0 +1,147 @@
1
+ # Generated from CLion Inspection settings
2
+ ---
3
+ Checks: '-*,
4
+ bugprone-argument-comment,
5
+ bugprone-assert-side-effect,
6
+ bugprone-bad-signal-to-kill-thread,
7
+ bugprone-branch-clone,
8
+ bugprone-copy-constructor-init,
9
+ bugprone-dangling-handle,
10
+ bugprone-dynamic-static-initializers,
11
+ bugprone-fold-init-type,
12
+ bugprone-forward-declaration-namespace,
13
+ bugprone-forwarding-reference-overload,
14
+ bugprone-inaccurate-erase,
15
+ bugprone-incorrect-roundings,
16
+ bugprone-integer-division,
17
+ bugprone-lambda-function-name,
18
+ bugprone-macro-parentheses,
19
+ bugprone-macro-repeated-side-effects,
20
+ bugprone-misplaced-operator-in-strlen-in-alloc,
21
+ bugprone-misplaced-pointer-arithmetic-in-alloc,
22
+ bugprone-misplaced-widening-cast,
23
+ bugprone-move-forwarding-reference,
24
+ bugprone-multiple-statement-macro,
25
+ bugprone-no-escape,
26
+ bugprone-parent-virtual-call,
27
+ bugprone-posix-return,
28
+ bugprone-reserved-identifier,
29
+ bugprone-sizeof-container,
30
+ bugprone-sizeof-expression,
31
+ bugprone-spuriously-wake-up-functions,
32
+ bugprone-string-constructor,
33
+ bugprone-string-integer-assignment,
34
+ bugprone-string-literal-with-embedded-nul,
35
+ bugprone-suspicious-enum-usage,
36
+ bugprone-suspicious-include,
37
+ bugprone-suspicious-memset-usage,
38
+ bugprone-suspicious-missing-comma,
39
+ bugprone-suspicious-semicolon,
40
+ bugprone-suspicious-string-compare,
41
+ bugprone-suspicious-memory-comparison,
42
+ bugprone-suspicious-realloc-usage,
43
+ bugprone-swapped-arguments,
44
+ bugprone-terminating-continue,
45
+ bugprone-throw-keyword-missing,
46
+ bugprone-too-small-loop-variable,
47
+ bugprone-undefined-memory-manipulation,
48
+ bugprone-undelegated-constructor,
49
+ bugprone-unhandled-self-assignment,
50
+ bugprone-unused-raii,
51
+ bugprone-unused-return-value,
52
+ bugprone-use-after-move,
53
+ bugprone-virtual-near-miss,
54
+ cert-dcl21-cpp,
55
+ cert-dcl58-cpp,
56
+ cert-err34-c,
57
+ cert-err52-cpp,
58
+ cert-err60-cpp,
59
+ cert-flp30-c,
60
+ cert-msc50-cpp,
61
+ cert-msc51-cpp,
62
+ cert-str34-c,
63
+ cppcoreguidelines-interfaces-global-init,
64
+ cppcoreguidelines-narrowing-conversions,
65
+ cppcoreguidelines-pro-type-member-init,
66
+ cppcoreguidelines-pro-type-static-cast-downcast,
67
+ cppcoreguidelines-slicing,
68
+ google-default-arguments,
69
+ google-explicit-constructor,
70
+ google-runtime-operator,
71
+ hicpp-exception-baseclass,
72
+ hicpp-multiway-paths-covered,
73
+ misc-misplaced-const,
74
+ misc-new-delete-overloads,
75
+ misc-no-recursion,
76
+ misc-non-copyable-objects,
77
+ misc-throw-by-value-catch-by-reference,
78
+ misc-unconventional-assign-operator,
79
+ misc-uniqueptr-reset-release,
80
+ modernize-avoid-bind,
81
+ modernize-concat-nested-namespaces,
82
+ modernize-deprecated-headers,
83
+ modernize-deprecated-ios-base-aliases,
84
+ modernize-loop-convert,
85
+ modernize-make-shared,
86
+ modernize-make-unique,
87
+ modernize-pass-by-value,
88
+ modernize-raw-string-literal,
89
+ modernize-redundant-void-arg,
90
+ modernize-replace-auto-ptr,
91
+ modernize-replace-disallow-copy-and-assign-macro,
92
+ modernize-replace-random-shuffle,
93
+ modernize-return-braced-init-list,
94
+ modernize-shrink-to-fit,
95
+ modernize-unary-static-assert,
96
+ modernize-use-auto,
97
+ modernize-use-bool-literals,
98
+ modernize-use-emplace,
99
+ modernize-use-equals-default,
100
+ modernize-use-equals-delete,
101
+ modernize-use-nodiscard,
102
+ modernize-use-noexcept,
103
+ modernize-use-nullptr,
104
+ modernize-use-override,
105
+ modernize-use-transparent-functors,
106
+ modernize-use-uncaught-exceptions,
107
+ mpi-buffer-deref,
108
+ mpi-type-mismatch,
109
+ openmp-use-default-none,
110
+ performance-faster-string-find,
111
+ performance-for-range-copy,
112
+ performance-implicit-conversion-in-loop,
113
+ performance-inefficient-algorithm,
114
+ performance-inefficient-string-concatenation,
115
+ performance-inefficient-vector-operation,
116
+ performance-move-const-arg,
117
+ performance-move-constructor-init,
118
+ performance-no-automatic-move,
119
+ performance-noexcept-move-constructor,
120
+ performance-trivially-destructible,
121
+ performance-type-promotion-in-math-fn,
122
+ performance-unnecessary-copy-initialization,
123
+ performance-unnecessary-value-param,
124
+ portability-simd-intrinsics,
125
+ readability-avoid-const-params-in-decls,
126
+ readability-const-return-type,
127
+ readability-container-size-empty,
128
+ readability-convert-member-functions-to-static,
129
+ readability-delete-null-pointer,
130
+ readability-deleted-default,
131
+ readability-inconsistent-declaration-parameter-name,
132
+ readability-make-member-function-const,
133
+ readability-misleading-indentation,
134
+ readability-misplaced-array-index,
135
+ readability-non-const-parameter,
136
+ readability-redundant-control-flow,
137
+ readability-redundant-declaration,
138
+ readability-redundant-function-ptr-dereference,
139
+ readability-redundant-smartptr-get,
140
+ readability-redundant-string-cstr,
141
+ readability-redundant-string-init,
142
+ readability-simplify-subscript-expr,
143
+ readability-static-accessed-through-instance,
144
+ readability-static-definition-in-anonymous-namespace,
145
+ readability-string-compare,
146
+ readability-uniqueptr-delete-release,
147
+ readability-use-anyofallof'
mopr-0.0.10/.clangd ADDED
@@ -0,0 +1,8 @@
1
+ # clangd 配置:编译数据库来自 Ninja 旁路目录
2
+ #
3
+ # VS 生成器不产出 compile_commands.json,故另建 Ninja 目录(build/ninja-debug)
4
+ # 专供 clangd 使用;其复用 debug-dynamic 的 conan 依赖,无需单独安装。
5
+ # 切换/新增依赖后需在 x64 开发环境下重跑一次 configure 刷新(见 BUILDING.md)。
6
+
7
+ CompileFlags:
8
+ CompilationDatabase: build/ninja-debug
@@ -0,0 +1,34 @@
1
+ # 顶层配置(对所有文件生效)
2
+ root = true
3
+
4
+ [*] # 所有文件
5
+ charset = utf-8 # 编码
6
+ end_of_line = lf # 换行符(Linux/macOS风格)
7
+ insert_final_newline = true # 文件末尾保留空行
8
+ trim_trailing_whitespace = true # 删除行尾空格
9
+
10
+ # 针对 Windows 批处理文件的配置
11
+ [*.{bat,cmd}]
12
+ charset = gbk # 编码
13
+ end_of_line = crlf # 强制使用 CRLF(Windows 风格)
14
+ trim_trailing_whitespace = false # 避免破坏批处理命令中的空格
15
+ insert_final_newline = true # 文件末尾保留空行(可选)
16
+
17
+ # Python 文件特定配置
18
+ [*.py]
19
+ indent_style = space # 缩进风格:空格
20
+ indent_size = 4 # 缩进大小:4空格(符合PEP 8)
21
+ max_line_length = 120 # 行长度限制(可自定义)
22
+
23
+ # 测试文件可能允许稍长行宽
24
+ [*/tests/*.py]
25
+ max_line_length = 160
26
+
27
+ # 配置文件(如YAML/JSON)
28
+ [*.{yml,yaml,json}]
29
+ indent_style = space
30
+ indent_size = 2 # 通常为2空格
31
+
32
+ # Markdown文件
33
+ [*.md]
34
+ trim_trailing_whitespace = false # 允许行尾空格(用于换行)
@@ -0,0 +1,15 @@
1
+ *.bat text working-tree-encoding=GBK eol=crlf
2
+ *.py text eol=lf
3
+ *.go text eol=lf
4
+ *.rs text eol=lf
5
+ *.java text eol=lf
6
+ *.ps1 text eol=lf
7
+ *.json text eol=lf
8
+ *.toml text eol=lf
9
+ *.md text eol=lf
10
+ *.yml text eol=lf
11
+ *.yaml text eol=lf
12
+ *.cmake text eol=lf
13
+ *.cpp text eol=lf
14
+ *.h text eol=lf
15
+ *.proto text eol=lf
mopr-0.0.10/.gitignore ADDED
@@ -0,0 +1,199 @@
1
+ # Prerequisites
2
+ *.d
3
+
4
+ # Compiled Object files
5
+ *.slo
6
+ *.lo
7
+ *.o
8
+ *.obj
9
+
10
+ # Precompiled Headers
11
+ *.gch
12
+ *.pch
13
+
14
+ # Compiled Dynamic libraries
15
+ *.so
16
+ *.dylib
17
+ *.dll
18
+
19
+ # Fortran module files
20
+ *.mod
21
+ *.smod
22
+
23
+ # Compiled Static libraries
24
+ *.lai
25
+ *.la
26
+ *.a
27
+ *.lib
28
+
29
+ # Executables
30
+ *.exe
31
+ *.out
32
+ *.app
33
+
34
+ # Test data
35
+ data/
36
+
37
+ # Python
38
+
39
+ # Byte-compiled / optimized / DLL files
40
+ __pycache__/
41
+ *.py[cod]
42
+ *$py.class
43
+
44
+ # Distribution / packaging
45
+ .Python
46
+ build/
47
+ develop-eggs/
48
+ dist/
49
+ downloads/
50
+ eggs/
51
+ .eggs/
52
+ lib/
53
+ lib64/
54
+ parts/
55
+ sdist/
56
+ var/
57
+ wheels/
58
+ share/python-wheels/
59
+ *.egg-info/
60
+ .installed.cfg
61
+ *.egg
62
+ _version.py
63
+ MANIFEST
64
+
65
+ # Installer logs
66
+ pip-log.txt
67
+ pip-delete-this-directory.txt
68
+
69
+ # Unit test / coverage reports
70
+ htmlcov/
71
+ .tox/
72
+ .nox/
73
+ .coverage
74
+ .coverage.*
75
+ .cache
76
+ nosetests.xml
77
+ coverage.xml
78
+ *.cover
79
+ *.py,cover
80
+ .hypothesis/
81
+ .pytest_cache/
82
+ cover/
83
+
84
+ # Translations
85
+ *.mo
86
+ *.pot
87
+
88
+ # Sphinx documentation
89
+ docs/_build/
90
+
91
+ # PyBuilder
92
+ .pybuilder/
93
+
94
+ # Jupyter Notebook
95
+ .ipynb_checkpoints
96
+
97
+ # pyenv / pipenv / poetry / pdm
98
+ #.python-version
99
+ Pipfile.lock
100
+ #poetry.lock
101
+ #pdm.lock
102
+ #.pdm.toml
103
+
104
+ # PEP 582
105
+ __pypackages__/
106
+
107
+ # Environments
108
+ .env
109
+ .env.*
110
+ .venv
111
+ env/
112
+ venv/
113
+ ENV/
114
+ env.bak/
115
+ venv.bak/
116
+
117
+ # mypy
118
+ .mypy_cache/
119
+ .dmypy.json
120
+ dmypy.json
121
+
122
+ # Pyre type checker
123
+ .pyre/
124
+
125
+ # pytype static type analyzer
126
+ .pytype/
127
+
128
+ # Cython debug symbols
129
+ cython_debug/
130
+
131
+ # Ruff
132
+ .ruff_cache/
133
+
134
+ # Rust
135
+
136
+ # Generated by Cargo
137
+ # will have compiled files and executables
138
+ debug/
139
+ target/
140
+
141
+ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
142
+ # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
143
+ Cargo.lock
144
+
145
+ # These are backup files generated by rustfmt
146
+ **/*.rs.bk
147
+
148
+ # MSVC Windows builds of rustc generate these files, which require debugging symbols
149
+ *.pdb
150
+
151
+ # Go
152
+
153
+ # Binaries for programs and plugins (generic ones already covered above)
154
+ *.exe~
155
+
156
+ # Test binary, built with `go test -c`
157
+ *.test
158
+
159
+ # Dependency directories (remove the comment below to include it)
160
+ # vendor/
161
+
162
+ # Go workspace file
163
+ go.work
164
+ go.work.sum
165
+
166
+ # Java
167
+
168
+ # Compiled class file
169
+ *.class
170
+
171
+ # Log file
172
+ *.log
173
+
174
+ # BlueJ files
175
+ *.ctxt
176
+
177
+ # Mobile Tools for Java (J2ME)
178
+ .mtj.tmp/
179
+
180
+ # Package Files #
181
+ *.jar
182
+ *.war
183
+ *.nar
184
+ *.ear
185
+ *.zip
186
+ *.tar.gz
187
+ *.rar
188
+
189
+ # virtual machine crash logs, see https://www.java.com/en/download/help/error_hotspot.html
190
+ hs_err_pid*
191
+ replay_pid*
192
+
193
+ # --- conan/CMake 2 工程专属(追加规则,以下来自 conan install / cmake 产物) ---
194
+
195
+ # conan install 生成的本机用户级预设(机器相关,不提交)
196
+ CMakeUserPresets.json
197
+
198
+ # 仓库根的 compile_commands.json 软链(指向 build/Release 下由 CMake 导出的产物)
199
+ compile_commands.json
@@ -0,0 +1,19 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Debug mopr(debug-dynamic)",
6
+ "type": "cppvsdbg",
7
+ "request": "launch",
8
+ "program": "${workspaceFolder}/build/debug-dynamic/Debug/mopr.exe",
9
+ "args": [
10
+ "100000000"
11
+ ],
12
+ "cwd": "${workspaceFolder}",
13
+ "console": "integratedTerminal",
14
+ "preLaunchTask": "mopr: build (debug-dynamic)",
15
+ "stopAtEntry": false,
16
+ "environment": []
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "C_Cpp.intelliSenseEngine": "disabled",
3
+ "cmake.configureOnOpen": false,
4
+ "cmake.useCMakePresets": "never",
5
+ "cmake.buildDirectory": "${workspaceFolder}/build/debug-dynamic",
6
+ "cmake.buildType": "Debug"
7
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "conan install (debug-dynamic)",
6
+ "type": "shell",
7
+ "command": "conan install . -s build_type=Debug -s compiler.runtime=dynamic --build=missing",
8
+ "options": {
9
+ "cwd": "${workspaceFolder}"
10
+ },
11
+ "problemMatcher": []
12
+ },
13
+ {
14
+ "label": "cmake configure (debug-dynamic)",
15
+ "type": "shell",
16
+ "command": "cmake --preset debug-dynamic",
17
+ "options": {
18
+ "cwd": "${workspaceFolder}"
19
+ },
20
+ "dependsOn": [
21
+ "conan install (debug-dynamic)"
22
+ ],
23
+ "dependsOrder": "sequence",
24
+ "problemMatcher": []
25
+ },
26
+ {
27
+ "label": "mopr: build (debug-dynamic)",
28
+ "type": "shell",
29
+ "command": "cmake --build --preset debug-dynamic",
30
+ "options": {
31
+ "cwd": "${workspaceFolder}"
32
+ },
33
+ "dependsOn": [
34
+ "cmake configure (debug-dynamic)"
35
+ ],
36
+ "dependsOrder": "sequence",
37
+ "group": {
38
+ "kind": "build",
39
+ "isDefault": true
40
+ },
41
+ "problemMatcher": [
42
+ "$msCompile"
43
+ ]
44
+ },
45
+ {
46
+ "label": "refresh clangd db (ninja-debug)",
47
+ "type": "shell",
48
+ "command": "powershell -NoProfile -ExecutionPolicy Bypass -File refresh-clangd.ps1",
49
+ "options": {
50
+ "cwd": "${workspaceFolder}"
51
+ },
52
+ "problemMatcher": []
53
+ }
54
+ ]
55
+ }
mopr-0.0.10/AGENTS.md ADDED
@@ -0,0 +1,89 @@
1
+ # AGENTS.md — 仓库协作规范
2
+
3
+ 本文件面向在本仓库工作的自动化 Agent 与协作者,列出必须遵守的约定。遇到与本文件冲突的做法时,以本文件为准。
4
+
5
+ ## 语言与版本要求
6
+
7
+ mopr 是单仓多语言库(monolibrary),同一语义将来可能有多种语言实现。各语言最低版本由本项目独立维护,不要求与同系列 `quant1x` 仓库同步:
8
+
9
+ | 语言 | 最低版本 | 说明 |
10
+ | --- | --- | --- |
11
+ | Python | 3.12+ | 3.12.x |
12
+ | Go | 1.27+ | 1.27.x |
13
+ | Rust | 1.98.0+ | 2024 edition |
14
+ | C++ | C++20 | GCC 13+ / Clang 17+ / MSVC 14.3+ |
15
+
16
+ - 编写各语言实现时,不得使用低于上表基线的语言特性与 API(含第三方依赖的最低版本要求)。
17
+ - 版本基线变更由本项目独立评估;README.md「语言与版本要求」为对外文档,两者保持一致。
18
+ - 当前仓库以 C++20 + MSVC v143 + CMake/Conan 2 为主验证。
19
+
20
+ ## git 提交规范
21
+
22
+ ### 1. 提交信息规范(含上级仓库约定)
23
+
24
+ 以下约定与上级 `quant1x` 仓库的提交规范保持一致:
25
+
26
+ - **提交标题与正文必须使用中文**,准确说明本次变更内容;必要时可保留英文术语(如 `fmt`、`VcpkgEnabled`、`conan_toolchain`)作为对象标识。
27
+ - **主题统一模板**:`<type>[<language>]:<summary>`(注意冒号为全角 `:`)。
28
+ - `<type>` 取值:`feat`(新特性)、`fix`(修复)、`refactor`(重构)、`perf`(性能)、`docs`(文档)、`test`(测试)、`chore`(例行维护)。
29
+ - `<language>` 取值:`python`、`c++`、`rust`、`go`、`multi`。mopr 是单仓多语言库(monolibrary),同一语义将来可能有多种语言实现,必须如实标注;本仓库当前以 `c++` 为主。多语言组合用半角逗号 `,` 分隔并按语义顺序书写(如 `python,c++`、`c++,rust`、`python,c++,rust,go`)——注意 `c++` 自身含 `+`,不用 `+` 连接以免出现 `c+++rust` 这类难读形式;变更仅涉及构建/工具/文档等不含代码语言的杂项时,标注其影响的实现语言,或使用 `multi`。
30
+ - **主题禁止仅写空泛描述**(如 `update` / `optimize` / `fix` 这类无对象的词),必须指明对象与语言,例如:
31
+ - `fix[c++]:修正 conan 静态运行时链接被 vcpkg 集成劫持的问题`
32
+ - `feat[c++]:重构 conan/cmake 多配置构建体系`
33
+ - `docs[c++]:更新 BUILDING.md 构建矩阵`
34
+ - **正文**在标题后空一行,以 `- ` 分条列出要点;**跨语言同步改动**(本仓库如引入 `c++,rust` 等)正文必须补充:
35
+ 1. 变更概述;
36
+ 2. 涉及语言与文件范围;
37
+ 3. 语义一致性说明;
38
+ 4. 验证方式/测试命令。
39
+
40
+ ```
41
+ feat[c++]:新增按 build_type/runtime 分目录的构建布局
42
+
43
+ - conanfile.layout 按 build_type 与 compiler.runtime 推导独立目录
44
+ - 验证:conan install . --build=missing && cmake --preset release-dynamic
45
+ ```
46
+
47
+ - **提交信息不得包含版本号、Git Tag 或发布相关信息**;tag 与版本号管理如另有工具负责(如 [autochangelog](https://gitee.com/quant1x/autochangelog)),不得手动干预。
48
+ - 提交前必须逐项核对清单(Checklist):
49
+ - [ ] 主题是否符合 `type[language]:summary` 模板?
50
+ - [ ] `type` 是否真实反映本次变更类型?
51
+ - [ ] `language` 是否准确标注本次涉及的开发语言,未标注或误标注视为不合规?
52
+ - [ ] 标题是否避免空泛描述、明确对象和影响?
53
+ - [ ] 正文是否包含要点(跨语言时含变更概述、文件范围、语义一致性、验证方式)?
54
+ - [ ] 是否未包含版本号 / Git Tag / 发布相关字符串?
55
+ - [ ] 是否以中文为主,能按语言维度快速过滤和回溯?
56
+
57
+ 任一项未满足,必须在提交前修正,不能直接提交。
58
+
59
+ ### 2. Windows 下提交信息的字符集约定(重要)
60
+
61
+ **背景**:Windows PowerShell 下在命令行内直接内嵌中文提交信息,会因 GBK/UTF-8 编码错乱导致解析失败(报错形如"字符串缺少终止符"或中文乱码),且此类失败发生在命令解析阶段,`&&` 前序命令(如 `git add`)也不会执行。
62
+
63
+ **标准做法**:涉及中文的提交信息不得直接写入命令行参数,必须按以下流程执行:
64
+
65
+ 1. 用工具(write_to_file)将提交信息写入 UTF-8 编码的临时文件,例如 `<仓库根>/.git/commit-msg.tmp`(放在 `.git/` 内,不污染工作树):
66
+ ```
67
+ chore: 中文标题
68
+
69
+ - 正文要点一
70
+ - 正文要点二
71
+ ```
72
+ 2. 依次执行暂存与提交:
73
+ ```
74
+ git add <文件>
75
+ git commit -F .git/commit-msg.tmp
76
+ ```
77
+ 3. 提交成功后删除临时文件:
78
+ ```
79
+ Remove-Item .git/commit-msg.tmp
80
+ ```
81
+
82
+ **推论**:任何需要在 Windows 命令行传递的中文内容(提交信息、`-m` 参数、脚本输入等)都应优先改用文件传递(`-F`、`--file` 等参数),规避编码问题。
83
+
84
+ ### 3. 其他
85
+
86
+ - 除非用户明确要求,不得执行 `git commit`、`git push`、`git rebase` 等写操作。
87
+ - 不做破坏性 git 操作(`push --force`、`reset --hard` 等)。
88
+ - tag 与版本号管理如另有工具负责(如 [autochangelog](https://gitee.com/quant1x/autochangelog)),不得手动干预。
89
+ - autochangelog 安装方法见 [BUILDING.md](BUILDING.md)「版本发布(autochangelog)」。