Repository: aws-cloudformation/cfn-lint

Issue:
`W8003` (`Fn::Equals` will always return `true` or `false`) doesn't validate if `Fn::Equals` will always return `false`
### CloudFormation Lint Version

1.20.1

### What operating system are you using?

Mac

### Describe the bug

The validation error message for `W8003` is:

> \<Condition\> will always return True or False

But `W8003` will never output a validation error if a condition always evaluates to `false`. `W8003` will only output a validation error if a condition always evaluates to `true`.

```
$ cfn-lint --format pretty --regions us-east-2 --include-checks I --configure-rule E3012:strict=True I3042:region=True I3042:accountId=True -- template.yaml

template.yaml
5:3:                W8003     ['true', 'true'] will always return True or False

Cfn-lint scanned 1 templates against 234 rules and found 0 errors, 1 warnings, and 0 informational violations
```

### Expected behavior

`W8003` should output a validation error if a condition always evaluates to `false`, or `W8003` should be updated to indicate that it will only output a validation error if a condition always evaluates to `true`.

### Reproduction template

```yaml
%YAML 1.2
---
AWSTemplateFormatVersion: 2010-09-09
Conditions:
  AlwaysTrueCondition: !Equals
    - "true"
    - "true"
  AlwaysFalseCondition: !Equals
    - "true"
    - "false"
Resources:
  AlwaysCreatedResource:
    Type: AWS::S3::Bucket
    Condition: AlwaysTrueCondition
  NeverCreatedResource:
    Type: AWS::S3::Bucket
    Condition: AlwaysFalseCondition
```


Discussion:

Patch:
diff --git a/src/cfnlint/rules/conditions/EqualsIsUseful.py b/src/cfnlint/rules/conditions/EqualsIsUseful.py
index ee74cf0247..181ecc5be5 100644
--- a/src/cfnlint/rules/conditions/EqualsIsUseful.py
+++ b/src/cfnlint/rules/conditions/EqualsIsUseful.py
@@ -50,8 +50,16 @@ def equals_is_useful(self, validator, s, instance, schema):
                 first = "true" if first else "false"
             if str(first) == str(second):
                 yield ValidationError(
-                    f"{instance!r} will always return {True!r} or {False!r}",
+                    f"{instance!r} will always return {True!r}",
                     rule=self,
                 )
+            if isinstance(instance[0], (str, float, int, bool)) and isinstance(
+                instance[1], (str, float, int, bool)
+            ):
+                if str(first) != str(second):
+                    yield ValidationError(
+                        f"{instance!r} will always return {False!r}",
+                        rule=self,
+                    )
         except:  # noqa: E722
             pass


Test patch:
diff --git a/test/unit/rules/conditions/test_equals_is_useful.py b/test/unit/rules/conditions/test_equals_is_useful.py
index 7db7ffa116..421c3d62ea 100644
--- a/test/unit/rules/conditions/test_equals_is_useful.py
+++ b/test/unit/rules/conditions/test_equals_is_useful.py
@@ -15,10 +15,12 @@
         ("Equal string and integer", [1, "1"], 1),
         ("Equal string and boolean", [True, "true"], 1),
         ("Equal string and number", [1.0, "1.0"], 1),
-        ("Not equal string and integer", [1, "1.1"], 0),
-        ("Not equal string and boolean", [True, "True"], 0),
+        ("Not equal string and integer", [1, "1.1"], 1),
+        ("Not equal string and boolean", [True, "True"], 1),
         ("No error on bad type", {"true": True}, 0),
         ("No error on bad length", ["a", "a", "a"], 0),
+        ("No with string and account id", ["A", {"Ref": "AWS::AccountId"}], 0),
+        ("No with string and account id", [{"Ref": "AWS::AccountId"}, "A"], 0),
     ],
 )
 def test_names(name, instance, num_of_errors):
@@ -26,4 +28,4 @@ def test_names(name, instance, num_of_errors):
     validator = CfnTemplateValidator({})
     assert (
         len(list(rule.equals_is_useful(validator, {}, instance, {}))) == num_of_errors
-    ), f"Expected {num_of_errors} errors for {name}"
+    ), f"Expected {num_of_errors} errors for {name} and {instance}"