Skip to content

Commit

Permalink
fix(deps): update dependency fr.inria.gforge.spoon:spoon-core to v10.…
Browse files Browse the repository at this point in the history
…4.2 (#1060)

* fix(deps): update dependency fr.inria.gforge.spoon:spoon-core to v10.4.2

* fix: comply with Spoon's pretty printing modification

* tests: fix lookup of docs URL

* Update python in CI

* up

* tests: initialize default timezone

* Revert "tests: initialize default timezone"

This reverts commit bddee37.

* tests: initialize default timezone

* Push resource

* Fix achievements test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Aman Sharma <[email protected]>
  • Loading branch information
renovate[bot] and algomaster99 authored Oct 21, 2023
1 parent b593673 commit bafec59
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ jobs:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: 3.8
python-version: '3.10.12'
update-environment: false
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
java-version: 11
Expand Down
4 changes: 2 additions & 2 deletions experimentation/tools/sorald/prmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def get_rule_doc_url(rule_key: int, handled_rules_url: str = HANDLED_RULES_URL)
handled_rules = requests.get(handled_rules_url, headers={"Content-Type": "text/html"}).content.decode()
markup = BeautifulSoup(handled_rules, features="html.parser")

for a_tag in markup.find_all("a", class_="\\\"anchor\\\""):
if f"sonar-rule-{rule_key}" in a_tag.attrs["id"]:
for a_tag in markup.find_all("a"):
if f"sonar-rule-{rule_key}" in a_tag.get("href"):
unescaped_atrr = a_tag.attrs["href"].replace("\\\"", "")
return f"{handled_rules_url}{unescaped_atrr}"

Expand Down
6 changes: 3 additions & 3 deletions experimentation/tools/sorald/prrecorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ def read_json_if_exists(path: Optional[pathlib.Path], encoding: str) -> dict:
def get_pr_state(pr: github.PullRequest.PullRequest) -> dict:
return {
jsonkeys.PR.URL: pr.html_url,
jsonkeys.PR.CREATED_AT: str(pr.created_at),
jsonkeys.PR.CLOSED_AT: str(pr.closed_at) if pr.closed_at else None,
jsonkeys.PR.MERGED_AT: str(pr.merged_at) if pr.closed_at else None,
jsonkeys.PR.CREATED_AT: str(pr.created_at.replace(tzinfo=datetime.timezone.utc)),
jsonkeys.PR.CLOSED_AT: str(pr.closed_at.replace(tzinfo=datetime.timezone.utc)) if pr.closed_at else None,
jsonkeys.PR.MERGED_AT: str(pr.merged_at.replace(tzinfo=datetime.timezone.utc)) if pr.merged_at else None,
jsonkeys.PR.STATE: pr.state,
jsonkeys.PR.IS_MERGED: pr.merged,
jsonkeys.PR.NUMBER: pr.number,
Expand Down
6 changes: 3 additions & 3 deletions experimentation/tools/tests/resources/prs_final.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"repoSlug": "redhat-developer/rsp-server",
"prMetadata": {
"url": "https://github.com/redhat-developer/rsp-server/pull/619",
"createdAt": "2020-11-25 12:01:06",
"closedAt": "2020-11-30 20:45:38",
"mergedAt": "2020-11-30 20:45:38",
"createdAt": "2020-11-25 12:01:06+00:00",
"closedAt": "2020-11-30 20:45:38+00:00",
"mergedAt": "2020-11-30 20:45:38+00:00",
"state": "closed",
"isMerged": true,
"number": 619
Expand Down
4 changes: 2 additions & 2 deletions experimentation/tools/tests/test_achievements.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_correctly_renders_merged_pr(tmp_path):
This document presents an overview of the pull requests performed with Sorald.
## [redhat-developer/rsp-server#619](https://github.com/redhat-developer/rsp-server/pull/619)
This PR was opened at 2020-11-25 12:01:06 and merged at 2020-11-30 20:45:38.
This PR was opened at 2020-11-25 12:01:06+00:00 and merged at 2020-11-30 20:45:38+00:00.
The patch was generated fully automatically with Sorald.
It provided the following repairs:
Expand Down Expand Up @@ -70,7 +70,7 @@ def test_correctly_renders_pr_without_repair_data(tmp_path):
This document presents an overview of the pull requests performed with Sorald.
## [redhat-developer/rsp-server#619](https://github.com/redhat-developer/rsp-server/pull/619)
This PR was opened at 2020-11-25 12:01:06 and merged at 2020-11-30 20:45:38.
This PR was opened at 2020-11-25 12:01:06+00:00 and merged at 2020-11-30 20:45:38+00:00.
The patch was generated fully automatically with Sorald.
Detailed repair information is missing for this PR.""".strip()
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<dependency>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-core</artifactId>
<version>10.3.0</version>
<version>10.4.2</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class SonarProcessorRepository implements ProcessorRepository {

// GENERATED FIELD
public static final String RULE_DESCRIPTIONS =
"S1068: Unused \"private\" fields should be removed\nS1118: Utility classes should not have public constructors\n\t(incomplete: Only handles implicit public constructor)\nS1132: Strings literals should be placed on the left side when checking for equality\nS1155: Collection.isEmpty() should be used to test for emptiness\nS1217: \"Thread.run()\" should not be called directly\nS1444: \"public static\" fields should be constant\n\t(incomplete: does not fix variable naming)\nS1481: Unused local variables should be removed\nS1596: \"Collections.EMPTY_LIST\", \"EMPTY_MAP\", and \"EMPTY_SET\" should not be used\nS1656: Variables should not be self-assigned\nS1854: Unused assignments should be removed\nS1860: Synchronization should not be based on Strings or boxed primitives\nS1948: Fields in a \"Serializable\" class should either be transient or serializable\nS2057: Every class implementing Serializable should declare a static final serialVersionUID.\n\t(incomplete: This processor does not address the case where the class already has a serialVersionUID with a non long type.)\nS2095: Resources should be closed\nS2097: \"equals(Object obj)\" should test argument type\nS2111: \"BigDecimal(double)\" should not be used\nS2116: \"hashCode\" and \"toString\" should not be called on array instances\nS2142: \"InterruptedException\" should not be ignored\nS2164: Math should not be performed on floats\n\t(incomplete: does not cast the operands to double when the expected type of the result is float.)\nS2167: \"compareTo\" should not return \"Integer.MIN_VALUE\"\nS2184: Math operands should be cast before assignment\nS2204: \".equals()\" should not be used to test the values of \"Atomic\" classes\nS2225: \"toString()\" and \"clone()\" methods should not return null\n\t(incomplete: does not fix null returning clone())\nS2272: \"Iterator.next()\" methods should throw \"NoSuchElementException\"\nS2755: XML parsers should not be vulnerable to XXE attacks\n\t(incomplete: This processor is a WIP and currently supports a subset of rule 2755. See Sorald\'s documentation for details.)\nS3032: JEE applications should not \"getClassLoader\"\nS3067: \"getClass\" should not be used for synchronization\nS3984: Exception should not be created without being thrown\nS4065: \"ThreadLocal.withInitial\" should be preferred\nS4973: Strings and Boxed types should be compared using \"equals()\"";
"S1068: Unused \"private\" fields should be removed\nS1118: Utility classes should not have public constructors\n\t(incomplete: Only handles implicit public constructor)\nS1132: Strings literals should be placed on the left side when checking for equality\nS1155: Collection.isEmpty() should be used to test for emptiness\nS1217: \"Thread.run()\" should not be called directly\nS1444: \"public static\" fields should be constant\n\t(incomplete: does not fix variable naming)\nS1481: Unused local variables should be removed\nS1596: \"Collections.EMPTY_LIST\", \"EMPTY_MAP\", and \"EMPTY_SET\" should not be used\nS1656: Variables should not be self-assigned\nS1854: Unused assignments should be removed\nS1860: Synchronization should not be based on Strings or boxed primitives\nS1948: Fields in a \"Serializable\" class should either be transient or serializable\nS2057: Every class implementing Serializable should declare a static final serialVersionUID.\n\t(incomplete: This processor does not address the case where the class already has a serialVersionUID with a non long type.)\nS2095: Resources should be closed\nS2097: \"equals(Object obj)\" should test argument type\nS2111: \"BigDecimal(double)\" should not be used\nS2116: \"hashCode\" and \"toString\" should not be called on array instances\nS2142: \"InterruptedException\" should not be ignored\nS2164: Math should not be performed on floats\n\t(incomplete: does not cast the operands to double when the expected type of the result is float.)\nS2167: \"compareTo\" should not return \"Integer.MIN_VALUE\"\nS2184: Math operands should be cast before assignment\nS2204: \".equals()\" should not be used to test the values of \"Atomic\" classes\nS2225: \"toString()\" and \"clone()\" methods should not return null\n\t(incomplete: does not fix null returning clone())\nS2272: \"Iterator.next()\" methods should throw \"NoSuchElementException\"\nS2755: XML parsers should not be vulnerable to XXE attacks\n\t(incomplete: This processor is a WIP and currently supports a subset of rule 2755. See Sorald's documentation for details.)\nS3032: JEE applications should not \"getClassLoader\"\nS3067: \"getClass\" should not be used for synchronization\nS3984: Exception should not be created without being thrown\nS4065: \"ThreadLocal.withInitial\" should be preferred\nS4973: Strings and Boxed types should be compared using \"equals()\"";

@Override
public Class<? extends SoraldAbstractProcessor<?>> getProcessor(String key) {
Expand Down

0 comments on commit bafec59

Please sign in to comment.