-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from YACLib/kononovk-setup
Setup repo
- Loading branch information
Showing
51 changed files
with
6,820 additions
and
1 deletion.
There are no files selected for viewing
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 @@ | ||
BasedOnStyle: Google | ||
Language: Cpp | ||
Standard: c++17 | ||
UseTab: Never | ||
DerivePointerAlignment: false | ||
PointerAlignment: Left | ||
ColumnLimit: 120 | ||
|
||
AllowShortLambdasOnASingleLine: None | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortBlocksOnASingleLine: Never | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortEnumsOnASingleLine: true # if false then enums would be formatted as Allman braces style | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLoopsOnASingleLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowAllArgumentsOnNextLine: false | ||
LambdaBodyIndentation: Signature | ||
BraceWrapping: | ||
BeforeLambdaBody: true | ||
AlignEscapedNewlines: Right | ||
ContinuationIndentWidth: 2 | ||
ConstructorInitializerIndentWidth: 2 | ||
AlignAfterOpenBracket: Align | ||
|
||
IncludeCategories: | ||
- Regex: '^".*"$' # relative includes | ||
Priority: 10 | ||
- Regex: '^<ione\/.*>$' # our library public includes | ||
Priority: 30 | ||
- Regex: '^<[[:alpha:]_\/]+>$' # STL | ||
Priority: 40 | ||
- Regex: '^<.*\.hpp>$' # our library private includes | ||
Priority: 20 | ||
- Regex: '.*' # other libraries (system headers in our case) | ||
Priority: 50 | ||
IncludeBlocks: Regroup | ||
IndentPPDirectives: AfterHash |
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,73 @@ | ||
Checks: '*, | ||
-abseil-*, | ||
-altera-*, | ||
-android-*, | ||
-boost-*, | ||
-google-objc-*, | ||
-linuxkernel-*, | ||
-llvmlibc-*, | ||
-mpi-*, | ||
-objc-*, | ||
-openmp-*, | ||
-cert-err58-cpp, | ||
-cppcoreguidelines-pro-type-static-cast-downcast, | ||
-fuchsia-default-arguments-*, | ||
-google-build-using-namespace, | ||
-modernize-use-trailing-return-type, | ||
-readability-identifier-length, | ||
-fuchsia-overloaded-operator, | ||
-cppcoreguidelines-pro-type-union-access, | ||
-hicpp-named-parameter, | ||
-modernize-use-default-member-init, | ||
-readability-named-parameter, | ||
-google-explicit-constructor, | ||
-hicpp-explicit-conversions, | ||
-llvm-header-guard, | ||
-cppcoreguidelines-owning-memory' | ||
|
||
WarningsAsErrors: '*' | ||
|
||
HeaderFilterRegex: '^<.*\.hpp>$' | ||
|
||
CheckOptions: | ||
- key: readability-identifier-naming.NamespaceCase | ||
value: lower_case | ||
- key: readability-identifier-naming.ClassCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.StructCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.TypedefCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.TypeAliasCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.FunctionCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.ParameterCase | ||
value: lower_case | ||
- key: readability-identifier-naming.VariableCase | ||
value: lower_case | ||
- key: readability-identifier-naming.PrivateMemberCase | ||
value: lower_case | ||
- key: readability-identifier-naming.PrivateMemberPrefix | ||
value: _ | ||
- key: readability-identifier-naming.GlobalConstantCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.GlobalConstantPrefix | ||
value: k | ||
- key: readability-identifier-naming.StaticConstantCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.StaticConstantPrefix | ||
value: k | ||
- key: readability-identifier-naming.ConstexprVariableCase | ||
value: CamelCase | ||
- key: readability-identifier-naming.ConstexprVariablePrefix | ||
value: k | ||
- key: readability-identifier-naming.TypeTemplateParameterCase | ||
value: CamelCase | ||
- key: readability-simplify-boolean-expr.ChainedConditionalReturn | ||
value: 1 | ||
- key: readability-simplify-boolean-expr.ChainedConditionalAssignment | ||
value: 1 | ||
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic | ||
value: 1 |
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 @@ | ||
* text=auto |
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,15 @@ | ||
# How to use git hooks for this repository: | ||
|
||
* Set `.githooks` directory as root directory for git hooks: | ||
|
||
```bash | ||
git config --local core.hooksPath ./.githooks | ||
``` | ||
|
||
or | ||
|
||
* Copy `pre-commit` file to `.git/hooks`: | ||
|
||
```bash | ||
cp ./.githooks/pre-commit ./.git/hooks/ | ||
``` |
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,58 @@ | ||
#!/usr/bin/env python | ||
|
||
import subprocess | ||
|
||
|
||
def last_line_valid(path): | ||
""" | ||
Check last file line have linebreak | ||
:param path: path to file | ||
:return: have or haven't | ||
""" | ||
with open(path, 'r') as f: | ||
text = f.readlines() | ||
try: | ||
last_char = text[-1][-1] | ||
return last_char == '\n' | ||
except IndexError: | ||
return False | ||
|
||
|
||
def fix_last_line(path): | ||
""" | ||
Add a linebreak to the end of file if it doesn't have one | ||
""" | ||
if last_line_valid(path): | ||
return | ||
with open(path, 'a') as f: | ||
print(f'Add linebreak to the file: {path}') | ||
f.write('\n') | ||
|
||
|
||
def fix_clang_format(path): | ||
""" | ||
Fix clang-format | ||
""" | ||
if path.endswith('.cpp') or path.endswith('.hpp'): | ||
print(f'clang-format fix: {path}') | ||
subprocess.Popen(['clang-format', path, '-i'], stdout=subprocess.DEVNULL).communicate() | ||
|
||
|
||
def fix_format(): | ||
git_diff = subprocess.Popen('git diff-index --name-status --cached HEAD'.split(), stdout=subprocess.PIPE) | ||
remove_deleted = subprocess.Popen('grep -v ^D'.split(), stdin=git_diff.stdout, stdout=subprocess.PIPE) | ||
get_second_column = subprocess.Popen(['awk', '{ print $2 }'], stdin=remove_deleted.stdout, stdout=subprocess.PIPE) | ||
git_diff.stdout.close() | ||
remove_deleted.stdout.close() | ||
output = get_second_column.communicate()[0].decode('utf-8').strip() | ||
if not output: | ||
return | ||
for file in output.split('\n'): | ||
path = f'./{file}' | ||
fix_last_line(path) | ||
fix_clang_format(path) | ||
subprocess.Popen(['git', 'add'] + output.split('\n')).communicate() | ||
|
||
|
||
if __name__ == '__main__': | ||
fix_format() |
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 @@ | ||
* @MBkkt @kononovk |
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 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser [e.g. stock browser, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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 @@ | ||
### Purpose | ||
|
||
~~Please use labels for this PR~~ | ||
|
||
~~Please describe the changes in this PR for reviewers~~ | ||
|
||
### Related Information | ||
|
||
- [ ] Design document: ... | ||
- [ ] Bench PR: ... | ||
|
||
### Testing | ||
|
||
- [ ] This change is a trivial rework or code cleanup without any test coverage. | ||
- [ ] This change is already covered by existing tests. | ||
- [ ] This PR adds tests that were used to verify all changes. | ||
- [ ] There are tests in an external testing repository: ... |
Oops, something went wrong.