Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '6ff9fa5e3d5e95aff46ca9c56d87f133d0faa8cb' as 'third-par…
…ty/CLI11'
- Loading branch information
Showing
153 changed files
with
37,269 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: 2.2.0.{build} | ||
|
||
branches: | ||
only: | ||
- main | ||
- v1 | ||
|
||
install: | ||
- git submodule update --init --recursive | ||
- py -3 --version | ||
- set PATH=C:\Python38-x64;C:\Python38-x64\Scripts;%PATH% | ||
- cmake --version | ||
- python --version | ||
- python -m pip --version | ||
- python -m pip install conan | ||
- conan user | ||
- conan --version | ||
|
||
build_script: | ||
- mkdir build | ||
- cd build | ||
- ps: | ||
cmake .. -DCLI11_WARNINGS_AS_ERRORS=ON -DCLI11_SINGLE_FILE_TESTS=ON | ||
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR="Visual Studio 14 2015" | ||
- ps: cmake --build . | ||
- cd .. | ||
- conan create . CLIUtils/CLI11 | ||
|
||
test_script: | ||
- cd build | ||
- ps: ctest --output-on-failure -C Debug | ||
|
||
notifications: | ||
- provider: Webhook | ||
url: https://webhooks.gitter.im/e/0185e91c5d989a476d7b | ||
on_build_success: false | ||
on_build_failure: true | ||
on_build_status_changed: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
steps: | ||
- task: CMake@1 | ||
inputs: | ||
cmakeArgs: | ||
.. -DCLI11_WARNINGS_AS_ERRORS=ON -DCLI11_SINGLE_FILE=$(cli11.single) | ||
-DCMAKE_CXX_STANDARD=$(cli11.std) | ||
-DCLI11_SINGLE_FILE_TESTS=$(cli11.single) | ||
-DCMAKE_BUILD_TYPE=$(cli11.build_type) $(cli11.options) | ||
displayName: "Configure" | ||
|
||
- script: cmake --build . -- -j2 --keep-going | ||
displayName: "Build Unix" | ||
workingDirectory: build | ||
condition: ne( variables['Agent.OS'], 'Windows_NT' ) | ||
|
||
- script: cmake --build . | ||
displayName: "Build Windows" | ||
workingDirectory: build | ||
condition: eq( variables['Agent.OS'], 'Windows_NT' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
steps: | ||
# Note that silkeh/clang does not include ca-certificates, so check the shasum for verification | ||
- bash: | | ||
wget --no-check-certificate "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | ||
echo "29faa62fb3a0b6323caa3d9557e1a5f1205614c0d4c5c2a9917f16a74f7eff68 cmake-3.14.3-Linux-x86_64.tar.gz" | shasum -sca 256 | ||
displayName: Download CMake | ||
- task: ExtractFiles@1 | ||
inputs: | ||
archiveFilePatterns: "cmake*.tar.gz" | ||
destinationFolder: "cmake_program" | ||
displayName: Extract CMake | ||
|
||
- bash: | ||
echo | ||
"##vso[task.prependpath]$(Build.SourcesDirectory)/cmake_program/cmake-3.14.3-Linux-x86_64/bin" | ||
displayName: Add CMake to PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
steps: | ||
- script: ctest --output-on-failure -C $(cli11.build_type) -T test | ||
displayName: "Test" | ||
workingDirectory: build | ||
|
||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: "cTest" | ||
testResultsFiles: "**/Test.xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
Language: Cpp | ||
BasedOnStyle: LLVM | ||
# AccessModifierOffset: -2 | ||
# AlignAfterOpenBracket: Align | ||
# AlignConsecutiveAssignments: false | ||
# AlignConsecutiveDeclarations: false | ||
# AlignEscapedNewlinesLeft: false | ||
# 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: false | ||
BinPackParameters: false | ||
# BraceWrapping: | ||
# AfterClass: false | ||
# AfterControlStatement: false | ||
# AfterEnum: false | ||
# AfterFunction: false | ||
# AfterNamespace: false | ||
# AfterObjCDeclaration: false | ||
# AfterStruct: false | ||
# AfterUnion: false | ||
# BeforeCatch: false | ||
# BeforeElse: false | ||
# IndentBraces: false | ||
# BreakBeforeBinaryOperators: None | ||
# BreakBeforeBraces: Attach | ||
# BreakBeforeTernaryOperators: true | ||
# BreakConstructorInitializersBeforeComma: false | ||
# BreakAfterJavaFieldAnnotations: false | ||
# BreakStringLiterals: true | ||
ColumnLimit: 120 | ||
# CommentPragmas: '^ IWYU pragma:' | ||
# ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
# ConstructorInitializerIndentWidth: 4 | ||
# ContinuationIndentWidth: 4 | ||
# Cpp11BracedListStyle: true | ||
# DerivePointerAlignment: false | ||
# DisableFormat: false | ||
# ExperimentalAutoDetectBinPacking: false | ||
# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] | ||
# IncludeIsMainRegex: '$' | ||
# IndentCaseLabels: false | ||
IndentWidth: 4 | ||
# IndentWrappedFunctionNames: false | ||
# JavaScriptQuotes: Leave | ||
# JavaScriptWrapImports: true | ||
# KeepEmptyLinesAtTheStartOfBlocks: true | ||
# MacroBlockBegin: '' | ||
# MacroBlockEnd: '' | ||
# MaxEmptyLinesToKeep: 1 | ||
# NamespaceIndentation: None | ||
# ObjCBlockIndentWidth: 2 | ||
# ObjCSpaceAfterProperty: false | ||
# ObjCSpaceBeforeProtocolList: true | ||
# PenaltyBreakBeforeFirstCallParameter: 19 | ||
# PenaltyBreakComment: 300 | ||
# PenaltyBreakFirstLessLess: 120 | ||
# PenaltyBreakString: 1000 | ||
# PenaltyExcessCharacter: 1000000 | ||
# PenaltyReturnTypeOnItsOwnLine: 60 | ||
# PointerAlignment: Right | ||
# ReflowComments: true | ||
SortIncludes: true | ||
# SpaceAfterCStyleCast: false | ||
# SpaceAfterTemplateKeyword: true | ||
# SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeParens: Never | ||
# SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
# SpacesInAngles: false | ||
# SpacesInContainerLiterals: true | ||
# SpacesInCStyleCastParentheses: false | ||
# SpacesInParentheses: false | ||
# SpacesInSquareBrackets: false | ||
Standard: Cpp11 | ||
TabWidth: 4 | ||
UseTab: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Checks that will be implemented in future PRs: | ||
# performance-unnecessary-value-param, hints to ~110 issues. Be careful with implementing the suggested changes of this one, as auto-fixes may break the code | ||
# bugprone-forwarding-reference-overload probably should be enabled and fixed. | ||
# clang-diagnostic-float-equal can be fixed by using _a from Catch::literals | ||
# bugprone-exception-escape due to main being a bit simple in examples | ||
# modernize-avoid-c-arrays trips up in TEMPLATE_TEST_CASE catch macro | ||
# modernize-return-braced-init-list triggers on lambdas ? | ||
# modernize-make-unique requires C++14 | ||
|
||
Checks: | | ||
*bugprone*, | ||
-bugprone-easily-swappable-parameters, | ||
-bugprone-forwarding-reference-overload, | ||
-bugprone-exception-escape, | ||
clang-analyzer-optin.cplusplus.VirtualCall, | ||
clang-analyzer-optin.performance.Padding, | ||
-clang-diagnostic-float-equal, | ||
cppcoreguidelines-init-variables, | ||
cppcoreguidelines-prefer-member-initializer, | ||
cppcoreguidelines-pro-type-static-cast-downcast, | ||
cppcoreguidelines-slicing, | ||
google-*, | ||
-google-runtime-references, | ||
llvm-include-order, | ||
llvm-namespace-comment, | ||
misc-definitions-in-headers, | ||
misc-misplaced-const, | ||
misc-non-copyable-objects, | ||
misc-static-assert, | ||
misc-throw-by-value-catch-by-reference, | ||
misc-throw-by-value-catch-by-reference, | ||
misc-uniqueptr-reset-release, | ||
misc-unused-parameters, | ||
modernize*, | ||
-modernize-use-trailing-return-type, | ||
-modernize-concat-nested-namespaces, | ||
-modernize-return-braced-init-list, | ||
-modernize-make-unique, | ||
*performance*, | ||
-performance-unnecessary-value-param, | ||
-performance-inefficient-string-concatenation, | ||
readability-avoid-const-params-in-decls, | ||
readability-const-return-type, | ||
readability-container-size-empty, | ||
readability-delete-null-pointer, | ||
readability-else-after-return, | ||
readability-implicit-bool-conversion, | ||
readability-inconsistent-declaration-parameter-name, | ||
readability-make-member-function-const, | ||
readability-misplaced-array-index, | ||
readability-non-const-parameter, | ||
readability-qualified-auto, | ||
readability-redundant-function-ptr-dereference, | ||
readability-redundant-smartptr-get, | ||
readability-redundant-string-cstr, | ||
readability-simplify-subscript-expr, | ||
readability-static-accessed-through-instance, | ||
readability-static-definition-in-anonymous-namespace, | ||
readability-string-compare, | ||
readability-suspicious-call-argument, | ||
readability-uniqueptr-delete-release, | ||
CheckOptions: | ||
- key: google-readability-braces-around-statements.ShortStatementLines | ||
value: "3" | ||
- key: performance-for-range-copy.WarnOnAllAutoCopies | ||
value: true | ||
- key: performance-inefficient-string-concatenation.StrictMode | ||
value: true | ||
- key: performance-unnecessary-value-param.AllowedTypes | ||
value: "exception_ptr$;" | ||
- key: readability-implicit-bool-conversion.AllowPointerConditions | ||
value: true | ||
- key: modernize-use-nodiscard.ReplacementString | ||
value: "CLI11_NODISCARD" | ||
|
||
HeaderFilterRegex: "CLI.*hpp" | ||
|
||
FormatStyle: file | ||
# WarningsAsErrors: "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
format: | ||
line_width: 99 | ||
|
||
# Causes a few issues - can be solved later, possibly. | ||
markup: | ||
enable_markup: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ignore: | ||
- "tests" | ||
- "examples" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
insert_final_newline = true | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
|
||
[*.cpp,*.hpp,*.py] | ||
indent_size = 4 | ||
|
||
[*.yml] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Contributing | ||
|
||
Thanks for considering to write a Pull Request (PR) for CLI11! Here are a few | ||
guidelines to get you started: | ||
|
||
Make sure you are comfortable with the license; all contributions are licensed | ||
under the original license. | ||
|
||
## Adding functionality | ||
|
||
Make sure any new functions you add are are: | ||
|
||
- Documented by `///` documentation for Doxygen | ||
- Mentioned in the instructions in the README, though brief mentions are okay | ||
- Explained in your PR (or previously explained in an Issue mentioned in the PR) | ||
- Completely covered by tests | ||
|
||
In general, make sure the addition is well thought out and does not increase the | ||
complexity of CLI11 needlessly. | ||
|
||
## Things you should know | ||
|
||
- Once you make the PR, tests will run to make sure your code works on all | ||
supported platforms | ||
- The test coverage is also measured, and that should remain 100% | ||
- Formatting should be done with pre-commit, otherwise the format check will not | ||
pass. However, it is trivial to apply this to your PR, so don't worry about | ||
this check. If you do want to run it, see below. | ||
- Everything must pass clang-tidy as well, run with | ||
`-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy)"` (if you set | ||
`"$(which clang-tidy) -fix"`, make sure you use a single threaded build | ||
process, or just build one example target). | ||
- Your changes must also conform to most of the | ||
[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) | ||
rules checked by [cpplint](https://github.com/cpplint/cpplint). For unused | ||
cpplint filters and justifications, see [CPPLINT.cfg](/CPPLINT.cfg). | ||
|
||
## Pre-commit | ||
|
||
Format is handled by pre-commit. You should install it (or use | ||
[pipx](https://pypa.github.io/pipx/)): | ||
|
||
```bash | ||
python3 -m pip install pre-commit | ||
``` | ||
|
||
Then, you can run it on the items you've added to your staging area, or all | ||
files: | ||
|
||
```bash | ||
pre-commit run | ||
# OR | ||
pre-commit run --all-files | ||
``` | ||
|
||
And, if you want to always use it, you can install it as a git hook (hence the | ||
name, pre-commit): | ||
|
||
```bash | ||
pre-commit install | ||
``` | ||
|
||
## For developers releasing to Conan.io | ||
|
||
This is now done by the CI system on tagged releases. Previously, the steps to | ||
make a Conan.io release were: | ||
|
||
```bash | ||
conan remove '*' # optional, I like to be clean | ||
conan create . cliutils/stable | ||
conan upload "*" -r cli11 --all | ||
``` | ||
|
||
Here I've assumed that the remote is `cli11`. | ||
|
||
## For maintainers: remember to add contributions | ||
|
||
In a commit to a PR, just add | ||
"`@all-contributors please add <username> for <contributions>`" or similar (see | ||
<https://allcontributors.org>). Use `code` for code, `bug` if an issue was | ||
submitted, `platform` for packaging stuff, and `doc` for documentation updates. | ||
|
||
To run locally, do: | ||
|
||
```bash | ||
yarn add --dev all-contributors-cli | ||
yarn all-contributors add username code,bug | ||
``` | ||
|
||
## For maintainers: Making a release | ||
|
||
Remember to replace the emoji in the readme, being careful not to replace the | ||
ones in all-contributors if any overlap. | ||
|
||
Steps: | ||
|
||
- Update changelog if needed | ||
- Update the version in `.appveyor.yml` and `include/CLI/Version.hpp`. | ||
- Find and replace in README (new minor/major release only): | ||
- Replace " 🆕" and "🆕 " with "" (ignores the description line) | ||
- Check for `\/\/$` (vi syntax) to catch leftover `// 🆕` | ||
- Replace "🚧" with "🆕" (manually ignore the description line) | ||
- Make a release in the GitHub UI, use a name such as "Version X.Y(.Z): Title" |
Oops, something went wrong.