PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: aquasecurity/tfsec (go)
Issue: Possible false positive with sensitive-in-attribute check
**Describe the bug**
When the `private_key_format` attribute is set in a `vault_pki_secret_backend_cert` resource for the Hashicorp Vault provider, the attribute is flagged as a sensitive-in-attribute finding

**To Reproduce**
```
provider "vault" {
  address = var.vault_address
  token   = var.vault_token
}

resource "vault_pki_secret_backend_cert" "server_cert" {
  backend     = var.vault_backend
  name        = var.vault_name
  common_name = var.server_name
  format = "pem"
  # this line is flagged
  private_key_format = "pkcs8"
}
```

**Expected behavior**
This shouldn't be a finding. The check refers to placing secrets in attributes whereas `private_key_format` defines the output format only.


**Additional context**
tfsec version 0.63.1

Pull request description: Remove false positive in vault pki
resolves #1219

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 ae728acd2..a79d3d3c6 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
@@ -38,6 +38,10 @@ var sensitiveWhitelist = []struct {
 		Resource:  "google_secret_manager_secret",
 		Attribute: "secret_id",
 	},
+	{
+		Resource:  "vault_pki_secret_backend_cert",
+		Attribute: "private_key_format",
+	},
 }
 
 func init() {


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 7044f0f3f..2077cbf8e 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
@@ -55,6 +55,26 @@ func Test_AWSSensitiveAttributes(t *testing.T) {
  }`,
 			mustExcludeResultCode: expectedCode,
 		},
+		{
+			name: "avoid vault pki false positive",
+			source: `
+provider "vault" {
+  address = var.vault_address
+  token   = var.vault_token
+}
+
+resource "vault_pki_secret_backend_cert" "server_cert" {
+  backend     = var.vault_backend
+  name        = var.vault_name
+  common_name = var.server_name
+  format = "pem"
+  # this line is flagged
+  private_key_format = "pkcs8"
+}
+
+            `,
+			mustExcludeResultCode: expectedCode,
+		},
 	}
 
 	for _, test := range tests {
Repository: goccy/go-yaml (go)
Issue: Yaml repeated nodes are not serialized correctly
Example template:

```yaml
spec:
  importantthing_one: &importantthing_one some stuff goes here
  otherstuff:
    foobar: *importantthing_one
```

I'd expect the output to match the input. In reality this is the output:
```yaml
 1 | spec:
 2 |   importantthing_one: &importantthing_onesome stuff goes here
 3 |   otherstuff:
 4 |     foobar: *importantthing_one
```

The space between the var name and the content has disappeared.
Pull request description: Fix origin buffer for anchor value
fix #169


Patch:
diff --git a/scanner/scanner.go b/scanner/scanner.go
index 4c99612..4ebee85 100644
--- a/scanner/scanner.go
+++ b/scanner/scanner.go
@@ -757,7 +757,7 @@ func (s *Scanner) scan(ctx *Context) (pos int) {
 				continue
 			}
 			s.addBufferedTokenIfExists(ctx)
-			s.progressColumn(ctx, 1)
+			pos-- // to rescan white space at next scanning for adding white space to next buffer.
 			s.isAnchor = false
 			return
 		}


Test patch:
diff --git a/printer/printer_test.go b/printer/printer_test.go
index b20a96a..02a304f 100644
--- a/printer/printer_test.go
+++ b/printer/printer_test.go
@@ -137,3 +137,15 @@ a:
 		p.PrintErrorMessage(src, true)
 	})
 }
+
+func TestPrinter_Anchor(t *testing.T) {
+	expected := `
+anchor: &x 1
+alias: *x`
+	tokens := lexer.Tokenize(expected)
+	var p printer.Printer
+	got := p.PrintTokens(tokens)
+	if expected != got {
+		t.Fatalf("unexpected output: expect:[%s]\n actual:[%s]", expected, got)
+	}
+}
Repository: rochacbruno/dynaconf (python)
Issue: [RFC] dynaconf list command should not show internal variables
**Is your feature request related to a problem? Please describe.**

When I run `dynaconf list` command line it shows all the variables I defined on my `settings.toml` file but it also shows dynaconf internal variables like `ENV_FOR_DYNACONF`, `RENAMED_VARS`, `ENVVAR_PREFIX` etc...

**Describe the solution you'd like**
I would like it by default to show only user defined settings when I run `dynaconf list` and the internal variables will show only if I pass `--all|-a` as in `dynaconf list -a`



Pull request description: Fix #179 - dynaconf list command shows only user defined vars

Patch:
diff --git a/dynaconf/cli.py b/dynaconf/cli.py
index e91e71a..b62d87e 100644
--- a/dynaconf/cli.py
+++ b/dynaconf/cli.py
@@ -364,8 +364,18 @@ def init(fileformat, path, env, _vars, _secrets, wg, y, django):
     default=None,
     help="a loader identifier to filter e.g: toml|yaml",
 )
-def _list(env, key, more, loader):
-    """Lists all defined config values"""
+@click.option(
+    "--all",
+    "_all",
+    "-a",
+    default=False,
+    is_flag=True,
+    help="show dynaconf internal settings?",
+)
+def _list(env, key, more, loader, _all=False):
+    """Lists all user defined config values
+    and if `--all` is passed it also shows dynaconf internal variables.
+    """
     if env:
         env = env.strip()
     if key:
@@ -397,6 +407,11 @@ def _list(env, key, more, loader):
     # remove to avoid displaying twice
     data.pop("SETTINGS_MODULE", None)
 
+    # if not --all remove internal settings
+    if not _all:
+        for name in dir(default_settings):
+            data.pop(name, None)
+
     def color(_k):
         if _k in dir(default_settings):
             return "blue"


Test patch:
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 10f5d78..41dd10c 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -83,9 +83,18 @@ def test_init_with_path(fileformat, tmpdir):
 
 
 def test_list(testdir):
+    """Test list command shows only user defined vars"""
 
     result = run(["list"], env={"ROOT_PATH_FOR_DYNACONF": testdir})
     assert "DOTENV_STR: 'hello'" in result
+    assert "GLOBAL_ENV_FOR_DYNACONF: 'DYNACONF'" not in result
+
+
+def test_list_with_all(testdir):
+    """Test list command with --all includes interval vars"""
+    result = run(["list", "-a"], env={"ROOT_PATH_FOR_DYNACONF": testdir})
+    assert "DOTENV_STR: 'hello'" in result
+    assert "GLOBAL_ENV_FOR_DYNACONF: 'DYNACONF'" in result
 
 
 @pytest.mark.parametrize("loader", WRITERS)
Repository: mgechev/revive (go)
Issue: comment-spacings false positives for nolint directives
**Describe the bug**
I'm using revive with golangci-lint and since the latest update I'm getting errors like this:
```
api/common/validate/validate.go:15:1: comment-spacings: no space between comment delimiter and comment text (revive)
//nolint:gochecknoglobals
```
I've updated the config to contain `nolint` in the `comment-spacings` arguments to make it go away but it's odd as this was not happening before.

**To Reproduce**
Steps to reproduce the behavior:
1. I updated golangci-lint:
```sh
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
```

2. I run it with the following flags & configuration file:
```shell
golangci-lint run
```

```yaml
linters:
  disable-all: true
  enable:
    - revive
linters-settings:
  revive:
    rules:
      - name: comment-spacings
        disabled: false
```


**Desktop (please complete the following information):**
 - OS: Ubuntu 22.04.2 LTS
 - go version go1.20.2 linux/amd64


Pull request description: Fix #808
Closes #808 by ignoring comments matching the official pattern for directives


Patch:
diff --git a/rule/comment-spacings.go b/rule/comment-spacings.go
index 0a29b96..bfb7eaf 100644
--- a/rule/comment-spacings.go
+++ b/rule/comment-spacings.go
@@ -20,12 +20,7 @@ func (r *CommentSpacingsRule) configure(arguments lint.Arguments) {
 	defer r.Unlock()
 
 	if r.allowList == nil {
-		r.allowList = []string{
-			"//go:",
-			"//revive:",
-			"//nolint:",
-		}
-
+		r.allowList = []string{}
 		for _, arg := range arguments {
 			allow, ok := arg.(string) // Alt. non panicking version
 			if !ok {
@@ -87,5 +82,5 @@ func (r *CommentSpacingsRule) isAllowed(line string) bool {
 		}
 	}
 
-	return false
+	return isDirectiveComment(line)
 }
diff --git a/rule/utils.go b/rule/utils.go
index 5778e76..8ffded4 100644
--- a/rule/utils.go
+++ b/rule/utils.go
@@ -165,3 +165,9 @@ func checkNumberOfArguments(expected int, args lint.Arguments, ruleName string)
 		panic(fmt.Sprintf("not enough arguments for %s rule, expected %d, got %d. Please check the rule's documentation", ruleName, expected, len(args)))
 	}
 }
+
+var directiveCommentRE = regexp.MustCompile("//(line |extern |export |[a-z0-9]+:[a-z0-9])") // see https://go-review.googlesource.com/c/website/+/442516/1..2/_content/doc/comment.md#494
+
+func isDirectiveComment(line string) bool {
+	return directiveCommentRE.MatchString(line)
+}


Test patch:
diff --git a/testdata/comment-spacings.go b/testdata/comment-spacings.go
index 92c832c..da8459b 100644
--- a/testdata/comment-spacings.go
+++ b/testdata/comment-spacings.go
@@ -47,3 +47,8 @@ type c struct {
 	//+optional
 	d *int `json:"d,omitempty"`
 }
+
+//extern open
+//export MyFunction
+
+//nolint:gochecknoglobals