From 1e5e61d638a71dbd89e97d408bb046337fa82aaa Mon Sep 17 00:00:00 2001 From: jeaye Date: Sun, 14 Jan 2024 03:59:54 +0000 Subject: [PATCH 1/8] Add automatic clang-format checking in CI --- .github/workflows/lint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a37423bdf..bf67b44a8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,3 +18,8 @@ jobs: version: 2022.10.16--22.13.50 - name: Lint bash scripts run: ./bin/ci/lint + - name: Run clang-format + uses: jidicula/clang-format-action@v4.11.0 + with: + clang-format-version: 13 + check-path: . From 01444dea2a94b7f45dc426ea69bfbf5337da1382 Mon Sep 17 00:00:00 2001 From: jeaye Date: Sun, 14 Jan 2024 18:18:00 +0000 Subject: [PATCH 2/8] Add .clang-format I manually went through ever option. Yes, it took a while. There's on thing which is currently not possible, for which I've made a ticket here: https://github.com/llvm/llvm-project/issues/78075 --- .clang-format | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..2f65c4ee8 --- /dev/null +++ b/.clang-format @@ -0,0 +1,119 @@ +--- +BasedOnStyle: Microsoft +#AllowBreakBeforeNoexceptSpecifier: OnlyWithParen +#AllowShortCompoundRequirementOnASingleLine: 'true' +#BracedInitializerIndentWidth: 2 +#BreakAdjacentStringLiterals: 'true' +#KeepEmptyLinesAtEOF: 'false' +#RemoveParentheses: Leave +#SpacesInParens: Never +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignArrayOfStructures: Right +AlignConsecutiveAssignments: 'false' +AlignConsecutiveBitFields: 'false' +AlignConsecutiveDeclarations: 'false' +AlignConsecutiveMacros: 'false' +AlignEscapedNewlines: Left +AlignOperands: 'false' +AlignTrailingComments: 'false' +AllowAllArgumentsOnNextLine: 'false' +AllowAllConstructorInitializersOnNextLine: 'false' +AllowAllParametersOfDeclarationOnNextLine: 'false' +AllowShortBlocksOnASingleLine: 'false' +AllowShortCaseLabelsOnASingleLine: 'false' +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: 'false' +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: 'false' +AlwaysBreakTemplateDeclarations: 'Yes' +BinPackArguments: 'false' +BinPackParameters: 'false' +BitFieldColonSpacing: Both +BreakAfterAttributes: Always +BreakArrays: 'false' +BreakBeforeBinaryOperators: All +BreakBeforeBraces: Custom +BreakBeforeConceptDeclarations: Always +BreakBeforeInlineASMColon: OnlyMultiline +BreakBeforeTernaryOperators: 'true' +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeComma +BreakStringLiterals: 'true' +ColumnLimit: '100' +CompactNamespaces: 'false' +ConstructorInitializerAllOnOneLineOrOnePerLine: 'false' +ConstructorInitializerIndentWidth: '2' +ContinuationIndentWidth: '2' +Cpp11BracedListStyle: 'false' +DerivePointerAlignment: 'false' +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: 'false' +FixNamespaceComments: 'false' +IncludeBlocks: Preserve +IndentAccessModifiers: 'false' +IndentCaseBlocks: 'true' +IndentCaseLabels: 'true' +IndentExternBlock: 'true' +IndentGotoLabels: 'false' +IndentPPDirectives: BeforeHash +IndentRequiresClause: 'false' +IndentWidth: '2' +IndentWrappedFunctionNames: 'false' +InsertBraces: 'true' +InsertNewlineAtEOF: 'true' +IntegerLiteralSeparator: + Binary: 8 + BinaryMinDigits: 8 + Decimal: 3 + DecimalMinDigits: 5 + Hex: -1 +KeepEmptyLinesAtTheStartOfBlocks: 'false' +LambdaBodyIndentation: Signature +Language: Cpp +LineEnding: LF +MaxEmptyLinesToKeep: '2' +NamespaceIndentation: All +PPIndentWidth: 2 +PackConstructorInitializers: Never +PenaltyReturnTypeOnItsOwnLine: 1 +PointerAlignment: Right +QualifierAlignment: Custom +QualifierOrder: [ 'static', 'constexpr', 'inline', 'volatile', 'friend', 'restrict', 'type', 'const' ] +ReflowComments: 'false' +RemoveBracesLLVM: 'false' +RemoveSemicolon: 'true' +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Always +ShortNamespaceLines: 0 +SortIncludes: 'false' +SortUsingDeclarations: 'false' +SpaceAfterCStyleCast: 'false' +SpaceAfterLogicalNot: 'false' +SpaceAfterTemplateKeyword: 'true' +SpaceAroundPointerQualifiers: Both +SpaceBeforeAssignmentOperators: 'true' +SpaceBeforeCaseColon: 'false' +SpaceBeforeCpp11BracedList: 'false' +SpaceBeforeCtorInitializerColon: 'true' +SpaceBeforeInheritanceColon: 'true' +SpaceBeforeParens: Never +SpaceBeforeRangeBasedForLoopColon: 'true' +SpaceInEmptyParentheses: 'false' +SpacesBeforeTrailingComments: '1' +SpacesInAngles: 'false' +SpacesInCStyleCastParentheses: 'false' +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParentheses: 'false' +SpacesInSquareBrackets: 'false' +Standard: c++20 +TabWidth: '2' +UseTab: Never + +... From b801f80a123f9c21e625dd00ddd1d507bd88aa49 Mon Sep 17 00:00:00 2001 From: Jeaye Wilkerson Date: Thu, 11 Jan 2024 23:09:08 -0800 Subject: [PATCH 3/8] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 128 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..32e7df1b6 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +conduct@jank-lang.org. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. From 8b2084f02c5cdc31a1210aea8cf10b731bed518d Mon Sep 17 00:00:00 2001 From: jeaye Date: Sun, 14 Jan 2024 19:05:04 +0000 Subject: [PATCH 4/8] Bump clang-format version in CI --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bf67b44a8..7a534f313 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,5 +21,5 @@ jobs: - name: Run clang-format uses: jidicula/clang-format-action@v4.11.0 with: - clang-format-version: 13 + clang-format-version: 16 check-path: . From 7ef0b7a194d8018a7bf5ae4f8711629580dac10c Mon Sep 17 00:00:00 2001 From: jeaye Date: Mon, 15 Jan 2024 22:41:21 +0000 Subject: [PATCH 5/8] Try adding jank syntax highlighting on Github Thanks to Adam Helins for the tip! --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..13e39be7c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.jank linguist-language=clojure From f7b11b6fbb96cd12949f9104ebad64aaabb0c0a3 Mon Sep 17 00:00:00 2001 From: jeaye Date: Fri, 2 Feb 2024 19:44:03 +0000 Subject: [PATCH 6/8] Bump clang-format version in CI --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7a534f313..4bb0f27b7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,5 +21,5 @@ jobs: - name: Run clang-format uses: jidicula/clang-format-action@v4.11.0 with: - clang-format-version: 16 + clang-format-version: 17 check-path: . From f40175b7e1ce4792197484ef5a8ee9ae6ed84f3c Mon Sep 17 00:00:00 2001 From: jeaye Date: Fri, 2 Feb 2024 20:01:17 +0000 Subject: [PATCH 7/8] Revert "Bump clang-format version in CI" This reverts commit f7b11b6fbb96cd12949f9104ebad64aaabb0c0a3. --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4bb0f27b7..7a534f313 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,5 +21,5 @@ jobs: - name: Run clang-format uses: jidicula/clang-format-action@v4.11.0 with: - clang-format-version: 17 + clang-format-version: 16 check-path: . From 605fb22d076e7a161cd206113db0749120d5b007 Mon Sep 17 00:00:00 2001 From: jeaye Date: Fri, 2 Feb 2024 20:01:53 +0000 Subject: [PATCH 8/8] Disable a clang-format config line The CI version doesn't have it; likely isn't new enough, even though they're both 16. --- .clang-format | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.clang-format b/.clang-format index 2f65c4ee8..9e9d90089 100644 --- a/.clang-format +++ b/.clang-format @@ -65,12 +65,13 @@ IndentWidth: '2' IndentWrappedFunctionNames: 'false' InsertBraces: 'true' InsertNewlineAtEOF: 'true' -IntegerLiteralSeparator: - Binary: 8 - BinaryMinDigits: 8 - Decimal: 3 - DecimalMinDigits: 5 - Hex: -1 +# CI isn't supporting this, even though it should be in 16. +#IntegerLiteralSeparator: +# Binary: 8 +# BinaryMinDigits: 8 +# Decimal: 3 +# DecimalMinDigits: 5 +# Hex: -1 KeepEmptyLinesAtTheStartOfBlocks: 'false' LambdaBodyIndentation: Signature Language: Cpp