             outputFiles: outputFiles
         )
     }
+
+    /// Validates the configuration file for various user errors.
+    private func validateConfiguration(_ configuration: Configuration) throws {
+        for invocation in configuration.invocations {
+            for protoFile in invocation.protoFiles {
+                if !protoFile.hasSuffix(".proto") {
+                    throw PluginError.invalidInputFileExtension
+                }
+            }
+        }
+    }
 }

    static let configurationFileName = "swift-protobuf-config.json"

    func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] {
        print("Creating build commands (\(UUID()))")

        // Let's check that this is a source target
        guard let target = target as? SourceModuleTarget else {
            throw PluginError.invalidTarget
        }

        // We need to find the configuration file at the root of the target
        guard let configurationFilePath = target.sourceFiles.first(where: { $0.path.lastComponent == Self.configurationFileName }) else {
            throw PluginError.noConfigFile
        }

        let data = try Data(contentsOf: URL(fileURLWithPath: "\(configurationFilePath.path)"))
        let configuration = try JSONDecoder().decode(Configuration.self, from: data)

        // We need to find the path of protoc and protoc-gen-swift
        let protocPath: Path

    enum PluginError: Error {
        /// Indicates that the target where the plugin was applied to was not `SourceModuleTarget`.
        case invalidTarget
        /// Indicates that the file extension of an input file was not `.proto`.
        case invalidInputFileExtension
    }

    /// The configuration of the plugin.
