PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: vue-a11y/eslint-plugin-vuejs-accessibility (ts)
Issue: Anchor has content question
Hi, I have a anchor tag that is an icon and, because of that, it has no text related to it. I've made some research and it seems we can use `aria-label` in scenarios like that. But, adding `aria-label` to the anchor tag, it still shows the error "vuejs-accessibility/anchor-has-content".

Should this rule consider a valid content, when the tag has aria-label attribute?

Thank you
Pull request description: For the `anchor-has-content` rule, allow anchors with explicit aria labels to pass
Closes #15


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2115072..d48ecb6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
 
 ## [Unreleased]
 
+### Changed
+
+- For the `anchor-has-content` rule, allow anchors with explicit aria labels to pass.
+
 ## [0.2.0] - 2020-06-26
 
 ### Changed
diff --git a/src/rules/anchor-has-content.js b/src/rules/anchor-has-content.js
index 904e63b..80a3e8c 100644
--- a/src/rules/anchor-has-content.js
+++ b/src/rules/anchor-has-content.js
@@ -1,6 +1,7 @@
 const {
   defineTemplateBodyVisitor,
   getElementType,
+  hasAriaLabel,
   hasContent,
   makeDocsURL
 } = require("../utils");
@@ -34,7 +35,11 @@ module.exports = {
         const elementTypes = ["a"].concat(components);
         const elementType = getElementType(node);
 
-        if (elementTypes.includes(elementType) && !hasContent(node)) {
+        if (
+          elementTypes.includes(elementType) &&
+          !hasContent(node) &&
+          !hasAriaLabel(node)
+        ) {
           context.report({ node, messageId: "default" });
         }
       }


Test patch:
diff --git a/src/rules/__tests__/anchor-has-content.test.js b/src/rules/__tests__/anchor-has-content.test.js
index cc9dcf3..7b0c8af 100644
--- a/src/rules/__tests__/anchor-has-content.test.js
+++ b/src/rules/__tests__/anchor-has-content.test.js
@@ -8,7 +8,8 @@ makeRuleTester("anchor-has-content", rule, {
     "<a v-text='msg' />",
     "<a v-html='msg' />",
     "<a><slot /></a>",
-    "<Anchor  />"
+    "<Anchor  />",
+    "<a aria-label='This is my label' />"
   ],
   invalid: [
     "<a />",
Repository: aquasecurity/tfsec (go)
Issue: kubernetes_service_account automount_service_account_token bool triggers general-secrets-sensitive-in-attribute rule
When defining `kubernetes_service_account`, if you set the `automount_service_account_token` explicitly, it triggers the `general-secrets-sensitive-in-attribute` rule.

Example resource def:

```
resource "kubernetes_service_account" "rule_breaker" {
  metadata {
    name      = var.name
    namespace = var.namespace
  }
  automount_service_account_token = "true"
}
```

Example output: 

```
  Result 1

  [general-secrets-sensitive-in-attribute][CRITICAL] Block 'module.aws_serviceaccount:kubernetes_service_account.rule_breaker[0]' includes a potentially sensitive attribute which is defined within the project.
.../main.tf:81


      78 |     }
      79 |   }
      80 |
      81 |   automount_service_account_token = "true"    string: "true"
      82 | }
      83 |

  Legacy ID:  GEN003
  Impact:     Block attribute could be leaking secrets
  Resolution: Don't include sensitive data in blocks
```

I think this should be whitelisted. We're not actually passing a secret with this attribute, it's just a boolean.

Pull request description: Whitelist kubernetes_service_account token
Resolves #1316

Patch:
diff --git a/internal/app/tfsec/rules/general/secrets/sensitive_in_attribute_rule.go b/internal/app/tfsec/rules/general/secrets/sensitive_in_attribute_rule.go
index a79d3d3c6..7e343ad7d 100644
--- a/internal/app/tfsec/rules/general/secrets/sensitive_in_attribute_rule.go
+++ b/internal/app/tfsec/rules/general/secrets/sensitive_in_attribute_rule.go
@@ -42,6 +42,10 @@ var sensitiveWhitelist = []struct {
 		Resource:  "vault_pki_secret_backend_cert",
 		Attribute: "private_key_format",
 	},
+	{
+		Resource:  "kubernetes_service_account",
+		Attribute: "automount_service_account_token",
+	},
 }
 
 func init() {
@@ -63,7 +67,7 @@ func init() {
  }
  
  resource "evil_corp" "good_example" {
- 	root_password = var.passwordx
+ 	root_password = var.password
  }
  `},
 		Base: secrets.CheckNotExposed,


Test patch:
diff --git a/internal/app/tfsec/rules/general/secrets/sensitive_in_attribute_rule_test.go b/internal/app/tfsec/rules/general/secrets/sensitive_in_attribute_rule_test.go
index 2077cbf8e..a6a095e3e 100644
--- a/internal/app/tfsec/rules/general/secrets/sensitive_in_attribute_rule_test.go
+++ b/internal/app/tfsec/rules/general/secrets/sensitive_in_attribute_rule_test.go
@@ -72,6 +72,19 @@ resource "vault_pki_secret_backend_cert" "server_cert" {
   private_key_format = "pkcs8"
 }
 
+            `,
+			mustExcludeResultCode: expectedCode,
+		},
+		{
+			name: "kubernetes_service_account automount_service_account_token",
+			source: `
+resource "kubernetes_service_account" "rule_breaker" {
+  metadata {
+    name      = var.name
+    namespace = var.namespace
+  }
+  automount_service_account_token = "true"
+}
             `,
 			mustExcludeResultCode: expectedCode,
 		},
Repository: s-knibbs/dataclasses-jsonschema (python)
Issue: Add to_json and from_json convenience methods
It'd be nice to add `from_json` and `to_json` methods for convenience
Pull request description: Add to_json and from_json convenience methods
Closes #35 

Patch:
diff --git a/dataclasses_jsonschema/__init__.py b/dataclasses_jsonschema/__init__.py
index b17098d..a139823 100644
--- a/dataclasses_jsonschema/__init__.py
+++ b/dataclasses_jsonschema/__init__.py
@@ -1,3 +1,4 @@
+import json
 import sys
 import functools
 from _decimal import Decimal
@@ -730,3 +731,10 @@ class JsonSchemaMixin:
             # The types in the 'typing' module lack the __name__ attribute
             match = re.match(r'typing\.([A-Za-z]+)', str(field_type))
             return str(field_type) if match is None else match.group(1)
+
+    @classmethod
+    def from_json(cls: Type[T], data: str, validate: bool = True, **json_kwargs) -> T:
+        return cls.from_dict(json.loads(data, **json_kwargs), validate)
+
+    def to_json(self, omit_none: bool = True, validate: bool = False, **json_kwargs) -> str:
+        return json.dumps(self.to_dict(omit_none, validate), **json_kwargs)


Test patch:
diff --git a/tests/test_core.py b/tests/test_core.py
index 793e572..51ac7df 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -219,6 +219,41 @@ def test_serialise_deserialise():
     assert data == f.to_dict()
 
 
+def test_from_json_to_json():
+    data = """
+{
+  "a": "2018-06-03T12:00:00+00:00",
+  "b": [
+    {
+      "z": 1.2,
+      "y": 1.5
+    }
+  ],
+  "c": {
+    "Mon": 1,
+    "Tue": 2
+  },
+  "d": "Wednesday",
+  "f": [
+    "xyz",
+    6
+  ],
+  "g": [
+    "abc"
+  ],
+  "e": "testing",
+  "h": {
+    "z": 0.5,
+    "y": 1.0
+  }
+}
+"""
+    f = Foo.from_json(data)
+    assert f.f == ('xyz', 6)
+    assert f.g == ('abc',)
+    assert data.strip() == f.to_json(indent=2)
+
+
 def test_invalid_data():
     with pytest.raises(ValidationError):
         Point.from_dict({'z': 3.14, 'y': 'wrong'})