diff --git a/lib/pragmater/formatter.rb b/lib/pragmater/formatter.rb
index <HASH>..<HASH> 100644
--- a/lib/pragmater/formatter.rb
+++ b/lib/pragmater/formatter.rb
@@ -27,6 +27,10 @@ module Pragmater
       /x
     end
 
+    def self.valid_formats
+      Regexp.union shebang_format, pragma_format
+    end
+
     def initialize comment
       @comment = comment
     end
diff --git a/spec/lib/pragmater/formatter_spec.rb b/spec/lib/pragmater/formatter_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/pragmater/formatter_spec.rb
+++ b/spec/lib/pragmater/formatter_spec.rb
@@ -55,6 +55,20 @@ RSpec.describe Pragmater::Formatter do
     end
   end
 
+  describe ".valid_formats" do
+    it "match shebang format" do
+      expect(described_class.valid_formats).to match("#! /usr/bin/ruby")
+    end
+
+    it "match frozen string literal format" do
+      expect(described_class.valid_formats).to match("# frozen_string_literal: true")
+    end
+
+    it "does not match general comments" do
+      expect(described_class.valid_formats).to_not match("# A example comment.")
+    end
+  end
+
   describe "#format_shebang" do
     subject { described_class.new comment }
Added valid formats to Formatter.

- Provides a convenience method for answering all
  possible valid comment formats.