Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,16 @@ env:
# as its floor, and tests/examples/mcpp-plugins builds against it. Engine
# warnings the members may newly print: W1 to W3 of SPEC-008 (the library
# interface), warnings only.
MCPP_VERSION: "2026.9.28.3"
#
# 2026.9.29.1 (mcpp-community/mcpp#738) builds a workspace as one graph per
# configuration: `mcpp test -p <member>` plans that member and what it
# reaches in the workspace's build directory, `target/<triple>/<key>/` at
# this repository's root, with the member's products in `bin/<name>/`. The
# members' own `tests/examples/*/target/` directories are no longer written.
# The directory name no longer hashes a package's own flags, so a member
# whose flags differ from another's shares the directory and ninja rebuilds
# the commands that changed.
MCPP_VERSION: "2026.9.29.1"

jobs:
lint:
Expand Down
7 changes: 7 additions & 0 deletions .mcpp/.xlings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"index_repos": [
{ "name": "compat", "url": "/tmp/claude-1000/idx/" }
],
"lang": "en",
"mirror": "auto"
}
6 changes: 6 additions & 0 deletions .mcpp/.xlings/.xlings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"configured": {
"compat:argparse@3.2": 0
},
"workspace": {}
}
1 change: 1 addition & 0 deletions .mcpp/.xlings/data/compat
Binary file added .mcpp/.xlings/data/runtimedir/v3.2.tar.gz
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions .mcpp/.xlings/data/xpkgs/compat-x-argparse/3.2/.mcpp_ok
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"os": "linux",
"version": "3.2",
"xlings_version": "2026.9.29.1",
"registered": 0,
"revision": 0
}
72 changes: 72 additions & 0 deletions .mcpp/.xlings/data/xpkgs/compat-x-argparse/3.2/.xpkg.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
-- compat.argparse — p-ranav/argparse, a single-header command line parser.
--
-- Shape B: one header at `include/argparse/argparse.hpp`, so `include_dirs` is
-- `*/include` and consumers write `#include <argparse/argparse.hpp>`.
--
-- The index's third answer to argument parsing, and they are not
-- interchangeable: `compat.CLI11` is the large one (subcommands, config files,
-- validators), `mcpplibs.cmdline` is the mcpp-native module, and this one is
-- the small header that models an argument as a typed `add_argument(...)`
-- chain and throws on a bad command line. A project already using it does not
-- want to be told to rewrite its `main`.
--
-- Needs C++17; `language = "c++23"` here is the index's usual setting for a
-- compat entry and does not force anything on a consumer's own dialect.
--
-- CN mirror: `gitcode.com/mcpp-res/argparse`, the upstream tarball re-hosted
-- BYTE-IDENTICALLY (verified: the mirror's sha256 equals the one declared
-- here, which is what lets one `sha256` serve both arms). GLOBAL stays the
-- default; CN is the fallback `mcpp self config --mirror CN` selects.
package = {
spec = "1",
namespace = "compat",
name = "argparse",
description = "argparse — header-only argument parser for modern C++",
licenses = {"MIT"},
repo = "https://github.com/p-ranav/argparse",
type = "package",

xpm = {
linux = {
["3.2"] = {
url = {
GLOBAL = "https://github.com/p-ranav/argparse/archive/refs/tags/v3.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/argparse/releases/download/3.2/argparse-3.2.tar.gz",
},
sha256 = "9dcb3d8ce0a41b2a48ac8baa54b51a9f1b6a2c52dd374e28cc713bab0568ec98",
},
},
macosx = {
["3.2"] = {
url = {
GLOBAL = "https://github.com/p-ranav/argparse/archive/refs/tags/v3.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/argparse/releases/download/3.2/argparse-3.2.tar.gz",
},
sha256 = "9dcb3d8ce0a41b2a48ac8baa54b51a9f1b6a2c52dd374e28cc713bab0568ec98",
},
},
windows = {
["3.2"] = {
url = {
GLOBAL = "https://github.com/p-ranav/argparse/archive/refs/tags/v3.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/argparse/releases/download/3.2/argparse-3.2.tar.gz",
},
sha256 = "9dcb3d8ce0a41b2a48ac8baa54b51a9f1b6a2c52dd374e28cc713bab0568ec98",
},
},
},

mcpp = {
language = "c++23",
import_std = false,
c_standard = "c11",
include_dirs = { "*/include" },
generated_files = {
["mcpp_generated/argparse_anchor.c"] =
"int mcpp_compat_argparse_anchor(void) { return 0; }\n",
},
sources = { "mcpp_generated/argparse_anchor.c" },
targets = { ["argparse"] = { kind = "lib" } },
deps = { },
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build --enable_platform_specific_config

build:linux --cxxopt=-std=c++17

build:windows --copt=/utf-8
build:windows --copt=/Zc:preprocessor
build:windows --cxxopt=/std:c++17
build:windows --cxxopt=/Zc:__cplusplus
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
RawStringFormats:
- Language: TextProto
Delimiters:
- 'pb'
- 'proto'
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
TabWidth: 8
UseTab: Never
...

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Checks:
-*,
clang-analyzer-*,
cppcoreguidelines-avoid-c-arrays,
cppcoreguidelines-special-member-functions,
readability-*,

CheckOptions:
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.ConstexprVariableCase, value: lower_case }
- { key: readability-identifier-naming.ConstexprVariableIgnoredRegexp, value: "^Is.+" }
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
- { key: readability-identifier-naming.PrivateMemberCase, value: lower_case }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: m_ }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.StructIgnoredRegexp, value: "parse_number" }
- { key: readability-identifier-naming.VariableCase, value: lower_case }

HeaderFilterRegex: 'argparse/.+\.hpp'
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

name: CI

on: pull_request

jobs:

test:

name: ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}

strategy:

matrix:

toolchain:
- macos-latest-clang
- macos-12-clang
- ubuntu-latest-clang
- ubuntu-latest-gcc
- windows-2019-msvc
- windows-latest-msvc
- windows-latest-clang

include:
- toolchain: macos-latest-clang
os: macos-latest
c_compiler: clang
cxx_compiler: clang++

- toolchain: macos-12-clang
os: macos-latest
c_compiler: clang
cxx_compiler: clang++

- toolchain: ubuntu-latest-clang
os: ubuntu-latest
c_compiler: clang
cxx_compiler: clang++

- toolchain: ubuntu-latest-gcc
os: ubuntu-latest
c_compiler: cc
cxx_compiler: g++

- toolchain: windows-2019-msvc
os: windows-2019
c_compiler: msvc
cxx_compiler: msvc

- toolchain: windows-latest-msvc
os: windows-latest
c_compiler: msvc
cxx_compiler: msvc

- toolchain: windows-latest-clang
os: windows-latest
c_compiler: clang-cl
cxx_compiler: clang-cl
cmake_opts: -T ClangCL

steps:

- name: Checkout Code
uses: actions/checkout@v2

- name: Configure
working-directory: test
run: cmake -S . -B build ${{ matrix.cmake_opts }}
env:
CC: ${{ matrix.c_compiler }}
CXX: ${{ matrix.cxx_compiler }}

- name: Build for ${{ matrix.os }} with ${{ matrix.compiler }}
working-directory: test
run: cmake --build build

- name: Test
if: ${{ ! startsWith(matrix.os, 'windows') }}
working-directory: test/build
run: ./tests

- name: Test (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
working-directory: test/build
run: ./Debug/tests.exe
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Insecure workflow with limited permissions that should provide analysis
# results through an artifact.
name: Tidy analysis

on: pull_request

jobs:

clang-tidy:

runs-on: ubuntu-20.04

steps:

- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy-12

- name: Prepare compile_commands.json
run: cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Create results directory
run: mkdir clang-tidy-result

- name: Analyze
run: git diff -U0 HEAD^ | clang-tidy-diff-12.py -p1 -regex ".+hpp" -extra-arg=-Iinclude -extra-arg=-std=c++17 -export-fixes clang-tidy-result/fixes.yml

- name: Save PR metadata
run: |
echo ${{ github.event.number }} > clang-tidy-result/pr-id.txt
echo ${{ github.event.pull_request.head.repo.full_name }} > clang-tidy-result/pr-head-repo.txt
echo ${{ github.event.pull_request.head.ref }} > clang-tidy-result/pr-head-ref.txt

- uses: actions/upload-artifact@v4
with:
name: clang-tidy-result
path: clang-tidy-result/
Loading
Loading