Repository: sqlfluff/sqlfluff (Python)

Issue:
layout.end-of-file is the only rule in kebab case
### Search before asking

- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.


### What Happened

Our rules are all in `snake_case`, except for `layout.end-of-file`

### Expected Behaviour

All rules should be in snake case

### Observed Behaviour

As above

### How to reproduce

-

### Dialect

NA

### Version

Main

### Configuration

NA

### Are you willing to work on and submit a PR to address the issue?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/sqlfluff/sqlfluff/blob/main/CODE_OF_CONDUCT.md)



Discussion:

Patch:
diff --git a/README.md b/README.md
index 43d641a0be5..fd73689c873 100644
--- a/README.md
+++ b/README.md
@@ -101,7 +101,7 @@ L:   1 | P:  14 | LT01 | Expected only single space before naked identifier.
 L:   1 | P:  27 | LT01 | Unnecessary trailing whitespace at end of file.
                        | [layout.spacing]
 L:   1 | P:  27 | LT12 | Files must end with a single trailing newline.
-                       | [layout.end-of-file]
+                       | [layout.end_of_file]
 All Finished 📜 🎉!
 ```
 
diff --git a/docs/generate-rule-docs.py b/docs/generate-rule-docs.py
index 109d1a4b49f..8551e190d42 100644
--- a/docs/generate-rule-docs.py
+++ b/docs/generate-rule-docs.py
@@ -41,8 +41,9 @@
         # Set the bundle name to the ref.
         _bundle_name = f":ref:`bundle_{bundle}`"
         for idx, rule in enumerate(rule_bundles[bundle]):
-            aliases = ", ".join(rule.aliases[:3]) + (
-                "," if len(rule.aliases) > 3 else ""
+            step = 1  # The number of aliases per line.
+            aliases = ", ".join(rule.aliases[:step]) + (
+                "," if len(rule.aliases) > step else ""
             )
             name_ref = f":sqlfluff:ref:`{rule.name}`"
             code_ref = f":sqlfluff:ref:`{rule.code}`"
@@ -51,15 +52,16 @@
                 f"| {code_ref : <28} | {aliases : <18} |\n"
             )
 
-            j = 3
+            j = 1
+
             while True:
                 if not rule.aliases[j:]:
                     break
-                aliases = ", ".join(rule.aliases[j : j + 3]) + (
-                    "," if len(rule.aliases[j:]) > 3 else ""
+                aliases = ", ".join(rule.aliases[j : j + step]) + (
+                    "," if len(rule.aliases[j:]) > step else ""
                 )
                 f.write(f"|{' ' * 42}|{' ' * 50}|{' ' * 30}| {aliases : <18} |\n")
-                j += 3
+                j += step
 
             if idx + 1 < len(rule_bundles[bundle]):
                 f.write(f"|{' ' * 42}+{'-' * 50}+{'-' * 30}+{'-' * 20}+\n")
diff --git a/docs/source/index.rst b/docs/source/index.rst
index fc486e242a7..6fee6331bee 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -46,7 +46,7 @@ have python or pip already installed see :ref:`gettingstartedref`.
     L:   1 | P:  27 | LT01 | Unnecessary trailing whitespace at end of file.
                            | [layout.spacing]
     L:   1 | P:  27 | LT12 | Files must end with a single trailing newline.
-                           | [layout.end-of-file]
+                           | [layout.end_of_file]
     All Finished 📜 🎉!
 
 Contents
diff --git a/src/sqlfluff/rules/layout/LT12.py b/src/sqlfluff/rules/layout/LT12.py
index 7f1f570e651..49cccf7a537 100644
--- a/src/sqlfluff/rules/layout/LT12.py
+++ b/src/sqlfluff/rules/layout/LT12.py
@@ -102,8 +102,10 @@ class Rule_LT12(BaseRule):
 
     """
 
-    name = "layout.end-of-file"
-    aliases = ("L009",)
+    name = "layout.end_of_file"
+    # Between 2.0.0 and 2.0.4 we supported had a kebab-case name for this rule
+    # so the old name remains here as an alias to enable backward compatibility.
+    aliases = ("L009", "layout.end-of-file")
     groups = ("all", "core", "layout")
 
     targets_templated = True


Test patch:
diff --git a/test/api/simple_test.py b/test/api/simple_test.py
index e83adfe204e..cc99435ab78 100644
--- a/test/api/simple_test.py
+++ b/test/api/simple_test.py
@@ -95,7 +95,7 @@
         "line_no": 1,
         "line_pos": 41,
         "description": "Files must end with a single trailing newline.",
-        "name": "layout.end-of-file",
+        "name": "layout.end_of_file",
     },
 ]