Skip to content

Commit

Permalink
feat!: from changed to singular positional argument (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperC286 authored Dec 17, 2024
1 parent 333bc62 commit 9f0e465
Show file tree
Hide file tree
Showing 25 changed files with 113 additions and 220 deletions.
37 changes: 0 additions & 37 deletions end-to-end-tests/features/from_arguments_conflicts.feature

This file was deleted.

10 changes: 5 additions & 5 deletions end-to-end-tests/features/from_commit_hash.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ Feature: A Git commit hash can be provided as an argument to indicate where to s

Scenario Outline:
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
When linting from the "<commit_hash>".
Then the linting passes.


Examples:
| repository | checkout_commit | from_commit_hash |
| repository | checkout_commit | commit_hash |
| https://github.com/danielduarte/diffparse.git | df6be23b79af66d3684fb27719020e1ce587f4b8 | 4f6bf53139fe66f61bd05893bcc9de6e96400c5c |


Scenario Outline: When you provide an invalid commit hash a relevant error message is returned.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
Then their is a could not find commit hash "<from_commit_hash>" error.
When linting from the "<commit_hash>".
Then their is a could not find commit hash "<commit_hash>" error.


Examples:
| repository | checkout_commit | from_commit_hash |
| repository | checkout_commit | commit_hash |
| https://github.com/SergioBenitez/Rocket.git | 549c9241c41320fc5af76b53c2ffc3bd8db88f8c | ecfc2c474575c6cdbc6d273c94c13181bd1dbaa6 |
24 changes: 12 additions & 12 deletions end-to-end-tests/features/from_reference.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@ Feature: A Git reference can be provided as an argument to indicate where to sta

Scenario Outline:
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-reference is provided as "<from_reference>".
When linting from the "<reference>".
Then the linting passes.


Examples:
| repository | checkout_commit | from_reference |
| https://github.com/yargs/yargs.git | 0f810245494ccf13a35b7786d021b30fc95ecad5 | v15.4.0 |
| repository | checkout_commit | reference |
| https://github.com/yargs/yargs.git | 0f810245494ccf13a35b7786d021b30fc95ecad5 | v15.4.0 |


Scenario Outline: You can also provide the long name and partial names not just the short name.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-reference is provided as "<from_full_reference>".
When linting from the "<full_reference>".
Then the linting passes.
Given the arguments are reset.
When the argument --from-reference is provided as "<from_partial_reference>".
When linting from the "<partial_reference>".
Then the linting passes.
Given the arguments are reset.
When the argument --from-reference is provided as "<from_short_reference>".
When linting from the "<short_reference>".
Then the linting passes.


Examples:
| repository | checkout_commit | from_full_reference | from_partial_reference | from_short_reference |
| https://github.com/yargs/yargs.git | 0f810245494ccf13a35b7786d021b30fc95ecad5 | refs/tags/v15.4.0 | tags/v15.4.0 | v15.4.0 |
| repository | checkout_commit | full_reference | partial_reference | short_reference |
| https://github.com/yargs/yargs.git | 0f810245494ccf13a35b7786d021b30fc95ecad5 | refs/tags/v15.4.0 | tags/v15.4.0 | v15.4.0 |


Scenario Outline: When you provide an invalid reference a relevant error message is returned.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-reference is provided as "<from_reference>".
Then their is a could not find reference "<from_reference>" error.
When linting from the "<reference>".
Then their is a could not find reference "<reference>" error.


Examples:
| repository | checkout_commit | from_reference |
| https://gitlab.com/Commit451/LabCoat | dcbed0075a41c221b37a3551db51572088fa6e2e | v2.7.4 |
| repository | checkout_commit | reference |
| https://gitlab.com/Commit451/LabCoat | dcbed0075a41c221b37a3551db51572088fa6e2e | v2.7.4 |
24 changes: 12 additions & 12 deletions end-to-end-tests/features/from_shortened_commit_hash.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ Feature: A shortened Git commit hash can be provided as an argument to indicate

Scenario Outline: A shortened and full Git commit hash can be used interchangeably.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
When linting from the "<commit_hash>".
Then the linting passes.
Given the arguments are reset.
When the argument --from-commit-hash is provided as "<shortened_from_commit_hash>".
When linting from the "<shortened_commit_hash>".
Then the linting passes.


Examples:
| repository | checkout_commit | from_commit_hash | shortened_from_commit_hash |
| https://github.com/danielduarte/diffparse.git | df6be23b79af66d3684fb27719020e1ce587f4b8 | 4f6bf53139fe66f61bd05893bcc9de6e96400c5c | 4f6bf53 |
| repository | checkout_commit | commit_hash | shortened_commit_hash |
| https://github.com/danielduarte/diffparse.git | df6be23b79af66d3684fb27719020e1ce587f4b8 | 4f6bf53139fe66f61bd05893bcc9de6e96400c5c | 4f6bf53 |


Scenario Outline: The shortened Git commit hash has no matches, so an error is returned.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_shortened_commit_hash>".
Then their is a could not find shortened commit hash "<from_shortened_commit_hash>" error.
When linting from the "<shortened_commit_hash>".
Then their is a could not find shortened commit hash "<shortened_commit_hash>" error.


Examples:
| repository | checkout_commit | from_shortened_commit_hash |
| https://gitlab.com/dmfay/massive-js.git | 482c364acf5505b81c55245fac0472890d351662 | 3f235ee |
| repository | checkout_commit | shortened_commit_hash |
| https://gitlab.com/dmfay/massive-js.git | 482c364acf5505b81c55245fac0472890d351662 | 3f235ee |


Scenario Outline: The shortened Git commit hash is ambiguous as multiple commit hashes match it, so an error is returned.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_shortened_commit_hash>".
Then their is a ambiguous shortened commit hash "<from_shortened_commit_hash>" error.
When linting from the "<shortened_commit_hash>".
Then their is a ambiguous shortened commit hash "<shortened_commit_hash>" error.


Examples:
| repository | checkout_commit | from_shortened_commit_hash |
| https://github.com/yargs/yargs.git | 089417550ef5a5b8ce3578dd2a989191300b64cd | 3f6 |
| repository | checkout_commit | shortened_commit_hash |
| https://github.com/yargs/yargs.git | 089417550ef5a5b8ce3578dd2a989191300b64cd | 3f6 |
4 changes: 2 additions & 2 deletions end-to-end-tests/features/from_stdin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Feature: A commit message can be provided by standard input rather than from a r

Scenario Outline:
Given the context and environment are reset.
When the flag --from-stdin is set and the standard input is "<standard_input>".
When linting the "<commit_message>".
Then the linting passes.


Examples:
| standard_input |
| commit_message |
| "test: adding stdin scenario variations" |
| "docs: correct spelling of CHANGELOG" |
| "fix: minor typos in code" |
32 changes: 16 additions & 16 deletions end-to-end-tests/features/git_environment_variables.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,65 @@ Feature: Git environment variables are respected and used instead of using the c

Scenario Outline:
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
When linting from the "<commit_hash>".
Then the linting passes.
Given the GIT_DIR environment variable is set to the cloned repository.
Then the linting passes.


Examples:
| repository | checkout_commit | from_commit_hash |
| repository | checkout_commit | commit_hash |
| https://github.com/danielduarte/diffparse.git | df6be23b79af66d3684fb27719020e1ce587f4b8 | 4f6bf53139fe66f61bd05893bcc9de6e96400c5c |


Scenario Outline: When you provide an invalid commit hash a relevant error message is returned.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
Then their is a could not find commit hash "<from_commit_hash>" error.
When linting from the "<commit_hash>".
Then their is a could not find commit hash "<commit_hash>" error.
Given the GIT_DIR environment variable is set to the cloned repository.
Then their is a could not find commit hash "<from_commit_hash>" error.
Then their is a could not find commit hash "<commit_hash>" error.


Examples:
| repository | checkout_commit | from_commit_hash |
| repository | checkout_commit | commit_hash |
| https://github.com/SergioBenitez/Rocket.git | 549c9241c41320fc5af76b53c2ffc3bd8db88f8c | ecfc2c474575c6cdbc6d273c94c13181bd1dbaa6 |


Scenario Outline:
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-reference is provided as "<from_reference>".
When linting from the "<reference>".
Then the linting passes.
Given the GIT_DIR environment variable is set to the cloned repository.
Then the linting passes.


Examples:
| repository | checkout_commit | from_reference |
| https://github.com/yargs/yargs.git | 0f810245494ccf13a35b7786d021b30fc95ecad5 | v15.4.0 |
| repository | checkout_commit | reference |
| https://github.com/yargs/yargs.git | 0f810245494ccf13a35b7786d021b30fc95ecad5 | v15.4.0 |


Scenario Outline: You can also provide the long name and partial names not just the short name.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-reference is provided as "<from_reference>".
When linting from the "<reference>".
Then the linting passes.
Given the GIT_DIR environment variable is set to the cloned repository.
Then the linting passes.


Examples:
| repository | checkout_commit | from_reference |
| repository | checkout_commit | reference |
| https://github.com/yargs/yargs.git | 0f810245494ccf13a35b7786d021b30fc95ecad5 | tags/v15.4.0 |
| https://github.com/yargs/yargs.git | 0f810245494ccf13a35b7786d021b30fc95ecad5 | refs/tags/v15.4.0 |


Scenario Outline: When you provide an invalid reference a relevant error message is returned.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-reference is provided as "<from_reference>".
Then their is a could not find reference "<from_reference>" error.
When linting from the "<reference>".
Then their is a could not find reference "<reference>" error.
Given the GIT_DIR environment variable is set to the cloned repository.
Then their is a could not find reference "<from_reference>" error.
Then their is a could not find reference "<reference>" error.


Examples:
| repository | checkout_commit | from_reference |
| https://gitlab.com/Commit451/LabCoat | dcbed0075a41c221b37a3551db51572088fa6e2e | v2.7.4 |
| repository | checkout_commit | reference |
| https://gitlab.com/Commit451/LabCoat | dcbed0075a41c221b37a3551db51572088fa6e2e | v2.7.4 |
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Feature: Only the first parent of merge commit's are parsed for their Git commit

Scenario Outline:
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
When linting from the "<commit_hash>".
And the argument --output is set as "JSON".
Then their are "<number_of_commits>" commits failing linting.


Examples:
| repository | checkout_commit | from_commit_hash | number_of_commits |
| repository | checkout_commit | commit_hash | number_of_commits |
| https://github.com/dcyou/resume | bbf42bd631b3ee85de650f46891619833c920bef | 0a74203f382e06b6f39f5143da1eee0be77d3acb | 4 |
12 changes: 6 additions & 6 deletions end-to-end-tests/features/history_mode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@ Feature: Specifies how commits are parsed, acceptable values are 'first' to pars

Scenario Outline: Only the first parent of merge commit's are parsed for their Git commit messages.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
When linting from the "<commit_hash>".
And the argument --output is set as "JSON".
Then their are "<default_number_of_commits>" commits failing linting.
When the argument --history-mode is provided as "all".
Then their are "<all_parent_number_of_commits>" commits failing linting.


Examples:
| repository | checkout_commit | from_commit_hash | default_number_of_commits | all_parent_number_of_commits |
| repository | checkout_commit | commit_hash | default_number_of_commits | all_parent_number_of_commits |
| https://github.com/lambci/awslambda.nim | 0fa0f62bec56eb7e09d8fd3e2a4c31798baba89f | 9c9583952ce709fbc6af3b85200c78bf417e5a11 | 5 | 6 |


Scenario Outline: Only the first parent of merge commit's are parsed for their Git commit messages.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
When linting from the "<commit_hash>".
And the argument --output is set as "JSON".
And the argument --history-mode is provided as "first".
Then their are "<number_of_commits>" commits failing linting.


Examples:
| repository | checkout_commit | from_commit_hash | number_of_commits |
| repository | checkout_commit | commit_hash | number_of_commits |
| https://github.com/dcyou/resume | bbf42bd631b3ee85de650f46891619833c920bef | 0a74203f382e06b6f39f5143da1eee0be77d3acb | 4 |


Scenario Outline: Only the first parent of merge commit's are parsed for their Git commit messages, by default.
Given the repository "<repository>" is cloned and checked out at the commit "<checkout_commit>".
When the argument --from-commit-hash is provided as "<from_commit_hash>".
When linting from the "<commit_hash>".
And the argument --output is set as "JSON".
Then their are "<number_of_commits>" commits failing linting.


Examples:
| repository | checkout_commit | from_commit_hash | number_of_commits |
| repository | checkout_commit | commit_hash | number_of_commits |
| https://github.com/dcyou/resume | bbf42bd631b3ee85de650f46891619833c920bef | 0a74203f382e06b6f39f5143da1eee0be77d3acb | 4 |
Loading

0 comments on commit 9f0e465

Please sign in to comment.