Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The body is truncated #3428

Closed
2 of 4 tasks
tehraninasab opened this issue Nov 24, 2022 · 0 comments · Fixed by #3476
Closed
2 of 4 tasks

The body is truncated #3428

tehraninasab opened this issue Nov 24, 2022 · 0 comments · Fixed by #3476
Assignees

Comments

@tehraninasab
Copy link
Contributor

tehraninasab commented Nov 24, 2022

Expected Behavior

The body shouldn't be truncated.

Current Behavior

The body is truncated unexpectedly when there is a pattern like '- Something between dashes -' in the commit message body:

The commit message:

Fix: catch/retry new -32002 err code

CI on master branch caught this:

```
Unhandled Exception:
System.AggregateException: One or more errors occurred. (Some problem when connecting to 'api.mycryptoapi.com/eth')

--- End of stack trace from previous location where exception was thrown ---

at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/runner/work/geewallet/geewallet/src/GWallet.Backend/FSharpUtil.fs:206
...
```

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Steps to Reproduce

Developed a local plugin like documented here:
https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-plugins.md#local-plugins
So the config file starts like this:

module.exports = {
    parserPreset: 'conventional-changelog-conventionalcommits',
    rules: {
        'body-leading-blank': [RuleStatus.Warning, 'always'],
        'body-soft-max-line-length': [RuleStatus.Error, 'always'],
        'footer-leading-blank': [RuleStatus.Warning, 'always'],
        'footer-max-line-length': [RuleStatus.Error, 'always', 150],
        'header-max-length': [RuleStatus.Error, 'always', 50],
        'subject-full-stop': [RuleStatus.Error, 'never', '.'],
        'type-empty': [RuleStatus.Warning, 'never'],
        'type-space-after-colon': [RuleStatus.Error, 'always'],
        'subject-lowercase': [RuleStatus.Error, 'always'],
        'body-prose': [RuleStatus.Error, 'always'],
        'type-space-after-comma': [RuleStatus.Error, 'always'],
        'trailing-whitespace': [RuleStatus.Error, 'always'],
        'prefer-slash-over-backslash': [RuleStatus.Error, 'always'],
        'type-space-before-paren': [RuleStatus.Error, 'always'],
        'proper-issue-refs': [RuleStatus.Error, 'always'],
    },
    plugins: [
        {
            rules: {
                'proper-issue-refs': ({body}: {body:any}) => {
                    let offence = false;   
                    if (body !== null) {
                        let bodyStr = convertAnyToString(body, "body");
                        console.log(bodyStr)
                        bodyStr = removeAllCodeBlocks(bodyStr);
                        offence = includeHashtagRef(bodyStr);
                    }

                    return [
                        !offence,
                        `Please use full URLs instead of #XYZ refs.`
                    ];
                },


...

  1. Run the plugin against the commit message mentioned in the Current Behaviour

  2. The body in 'body-soft-max-line-length' is truncated as mentioned in the Current Behaviour section.

Context

No response

commitlint --version

17.3.0

git --version

2.34.1

node --version

v18.12.1

tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
In the current version of commitlint the body is truncated
unexpectedly when there is a pattern like
'- Something between dashes -' in the commit message body.
The reason for this behavior is that in the commit parser
package the commitlint uses (conventional-commit-parser[1]),
this pattern '- something -' is a special pattern for any
arbitrary filed. For example, if you put '-myNote-' in the
commit message body, everything that comes after this field
will be saved in an arbitrary field called myNote (Or
whatever is written between dashes) and you can use it like
other fields (header, body, etc.), but I believe we should
disable this functionality because, in the commit messages
like the one in the bug report that this commit fixes, the
user might put stack trace in the commit message body and
this way it will be truncated unexpectedly.

Fixes conventional-changelog#3428

[1] https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-commits-parser/README.md
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
In the current version of commitlint the body is truncated
unexpectedly when there is a pattern like
'- Something between dashes -' in the commit message body.
The reason for this behavior is that in the commit parser
package the commitlint uses (conventional-commit-parser[1]),
this pattern '- something -' is a special pattern for any
arbitrary filed. For example, if you put '-myNote-' in the
commit message body, everything that comes after this field
will be saved in an arbitrary field called myNote (Or
whatever is written between dashes) and you can use it like
other fields (header, body, etc.), but I believe we should
disable this functionality because, in the commit messages
like the one in the bug report that this commit fixes, the
user might put stack trace in the commit message body and
this way it will be truncated unexpectedly.

Fixes conventional-changelog#3428

[1] https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-commits-parser/README.md
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
In the current version of commitlint the body is truncated
unexpectedly when there is a pattern like
'- Something between dashes -' in the commit message body.
The reason for this behavior is that in the commit parser
package the commitlint uses (conventional-commit-parser[1]),
this pattern '- something -' is a special pattern for any
arbitrary filed. For example, if you put '-myNote-' in the
commit message body, everything that comes after this field
will be saved in an arbitrary field called myNote (Or
whatever is written between dashes) and you can use it like
other fields (header, body, etc.), but I believe we should
disable this functionality because, in the commit messages
like the one in the bug report that this commit fixes, the
user might put stack trace in the commit message body and
this way it will be truncated unexpectedly.

Fixes conventional-changelog#3428

[1] https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-commits-parser/README.md
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
In the current version of commitlint the body is truncated
unexpectedly when there is a pattern like
'- Something between dashes -' in the commit message body.
The reason for this behavior is that in the commit parser
package the commitlint uses (conventional-commit-parser[1]),
this pattern '- something -' is a special pattern for any
arbitrary filed. For example, if you put '-myNote-' in the
commit message body, everything that comes after this field
will be saved in an arbitrary field called myNote (Or
whatever is written between dashes) and you can use it like
other fields (header, body, etc.), but I believe we should
disable this functionality because, in the commit messages
like the one in the bug report that this commit fixes, the
user might put stack trace in the commit message body and
this way it will be truncated unexpectedly.

Fixes conventional-changelog#3428

[1] https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-commits-parser/README.md
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
In the current version of commitlint the body is truncated
unexpectedly when there is a pattern like
'- Something between dashes -' in the commit message body.
The reason for this behavior is that in the commit parser
package the commitlint uses (conventional-commit-parser[1]),
this pattern '- something -' is a special pattern for any
arbitrary filed. For example, if you put '-myNote-' in the
commit message body, everything that comes after this field
will be saved in an arbitrary field called myNote (Or
whatever is written between dashes) and you can use it like
other fields (header, body, etc.), but I believe we should
disable this functionality because, in the commit messages
like the one in the bug report that this commit fixes, the
user might put stack trace in the commit message body and
this way it will be truncated unexpectedly.

Fixes conventional-changelog#3428

[1] https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-commits-parser/README.md
tehraninasab added a commit to tehraninasab/commitlint that referenced this issue Jan 3, 2023
In the current version of commitlint the body is truncated
unexpectedly when there is a pattern like
'- Something between dashes -' in the commit message body.
The reason for this behavior is that in the commit parser
package the commitlint uses (conventional-commit-parser[1]),
this pattern '- something -' is a special pattern for any
arbitrary filed. For example, if you put '-myNote-' in the
commit message body, everything that comes after this field
will be saved in an arbitrary field called myNote (Or
whatever is written between dashes) and you can use it like
other fields (header, body, etc.), but I believe we should
disable this functionality because, in the commit messages
like the one in the bug report that this commit fixes, the
user might put stack trace in the commit message body and
this way it will be truncated unexpectedly.

Fixes conventional-changelog#3428

[1] https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-commits-parser/README.md
escapedcat pushed a commit that referenced this issue Jan 4, 2023
* test(parser): add failing test

* fix: stop truncating the body in presence of dashes

In the current version of commitlint the body is truncated
unexpectedly when there is a pattern like
'- Something between dashes -' in the commit message body.
The reason for this behavior is that in the commit parser
package the commitlint uses (conventional-commit-parser[1]),
this pattern '- something -' is a special pattern for any
arbitrary filed. For example, if you put '-myNote-' in the
commit message body, everything that comes after this field
will be saved in an arbitrary field called myNote (Or
whatever is written between dashes) and you can use it like
other fields (header, body, etc.), but I believe we should
disable this functionality because, in the commit messages
like the one in the bug report that this commit fixes, the
user might put stack trace in the commit message body and
this way it will be truncated unexpectedly.

Fixes #3428

[1] https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-commits-parser/README.md
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Jan 31, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Jan 31, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 3, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 4, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 7, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 7, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 9, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 9, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 9, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 9, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 9, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 9, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 9, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 13, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 13, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 14, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 14, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 14, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 14, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
tehraninasab added a commit to tehraninasab/conventions that referenced this issue Feb 14, 2023
The workaround is not needed anymore because we're now using
a recent-enough version of commitlint that includes the fix
for the bug [1].

[1] conventional-changelog/commitlint#3428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants