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

adding language exceptions #379

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docs/automations/languages/java/review-java-exceptions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Automation - Review Java Exceptions
description: Automatically post a comment that requests the author to throw a specific exception.
---
# Review Java Exceptions

<!-- --8<-- [start:example]-->

Post a comment that requests the author to throw a specific exception.

![Review Java Exceptions](/automations/languages/java/review-java-exceptions/review-java-exceptions.png)

!!! info "Configuration Description"

Conditions (all must be true):

* A Java file is modified.
* A general exception is thrown.

Automation Actions:

* Post a comment that requests the author to specify the exception being thrown.

<div class="automationExample" markdown="1">
!!! example "Review Java Exceptions"
```yaml+jinja
--8<-- "docs/downloads/automation-library/languages/java/review_java_exceptions.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/languages/java/review_java_exceptions.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Automation - Review JavaScript Exceptions
description: Automatically post a comment that requests the author to throw a specific exception.
---
# Review JavaScript Exceptions

<!-- --8<-- [start:example]-->

Post a comment that requests the author to throw a specific exception.

![Review JavaScript Exceptions](/automations/languages/javascript/review-javascript-exceptions/review-javascript-exceptions.png)

!!! info "Configuration Description"

Conditions (all must be true):

* A JavaScript file is modified.
* A general exception is thrown.

Automation Actions:

* Post a comment that requests the author to specify the exception being thrown.

<div class="automationExample" markdown="1">
!!! example "Review JavaScript Exceptions"
```yaml+jinja
--8<-- "docs/downloads/automation-library/languages/javascript/review_javascript_exceptions.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/languages/javascript/review_javascript_exceptions.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Automation - Review Python Exceptions
description: Automatically post a comment that requests the author to throw a specific exception.
---
# Review Python Exceptions

<!-- --8<-- [start:example]-->

Post a comment that requests the author to throw a specific exception.

![Review Python Exceptions](/automations/languages/python/review-python-exceptions/review-python-exceptions.png)

!!! info "Configuration Description"

Conditions (all must be true):

* A Python file is modified.
* A general exception is thrown.

Automation Actions:

* Post a comment that requests the author to specify the exception being thrown.

<div class="automationExample" markdown="1">
!!! example "Review Python Exceptions"
```yaml+jinja
--8<-- "docs/downloads/automation-library/languages/python/review_python_exceptions.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/languages/python/review_python_exceptions.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/automations/languages/ruby/review-ruby-exceptions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Automation - Review Ruby Exceptions
description: Automatically post a comment that requests the author to throw a specific exception.
---
# Review Ruby Exceptions

<!-- --8<-- [start:example]-->

Post a comment that requests the author to throw a specific exception.

![Review Ruby Exceptions](/automations/languages/ruby/review-ruby-exceptions/review-ruby-exceptions.png)

!!! info "Configuration Description"

Conditions (all must be true):

* A Ruby file is modified.
* A general exception is thrown.

Automation Actions:

* Post a comment that requests the author to specify the exception being thrown.

<div class="automationExample" markdown="1">
!!! example "Review Ruby Exceptions"
```yaml+jinja
--8<-- "docs/downloads/automation-library/languages/python/review_python_exceptions.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/languages/python/review_python_exceptions.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- mode: yaml -*-
manifest:
version: 1.0
automations:
review_java_exceptions:
if:
- {{ source.diff.files | matchDiffLines(regex=r/throw new Exception/) | some }}
- {{ files | extensions | match(term='java') | every }}
run:
- action: add-comment@v1
args:
comment: |
This PR appears to throw exceptions that aren't specific. Please throw specific exceptions to add more clarity which simplifies the debugging process.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- mode: yaml -*-
manifest:
version: 1.0
automations:
review_javascript_exceptions:
if:
- {{ source.diff.files | matchDiffLines(regex=r/throw new Error| throw new Exception/) | some }}
- {{ files | extensions | match(term='js') | every }}
run:
- action: add-comment@v1
args:
comment: |
This PR appears to throw exceptions that aren't specific. Please throw specific exceptions to add more clarity which simplifies the debugging process.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- mode: yaml -*-
manifest:
version: 1.0
automations:
review_python_exceptions:
if:
- {{ source.diff.files | matchDiffLines(regex=r/raise Exception/) | some }}
- {{ files | extensions | match(term='py') | every }}
run:
- action: add-comment@v1
args:
comment: |
This PR appears to throw exceptions that aren't specific. Please throw specific exceptions to add more clarity which simplifies the debugging process.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- mode: yaml -*-
manifest:
version: 1.0
automations:
review_ruby_exceptions:
if:
- {{ source.diff.files | matchDiffLines(regex=r/raise "/) | some }}
- {{ files | extensions | match(term='rb') | every }}
run:
- action: add-comment@v1
args:
comment: |
This PR appears to throw exceptions that aren't specific. Please throw specific exceptions to add more clarity which simplifies the debugging process.