api/toolchain: Make filters optional for linting

This CL contains the changes generated by compile_build_api_proto after
adding a new field to the LinterRequest proto to make filtering
lints by whether or not they concern modified lines optional.

This CL also implements the change in the endpoint to actually use it,
and also updates the associated call_template.

This is to support using these endpoints to query for the list of
current lints in platform2.

BUG=b:229121199
TEST=./compile_build_api_proto

Change-Id: Ic309ea718855e0da19d3c688ee8007ba29635a9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3585344
Reviewed-by: Alex Klein <saklein@chromium.org>
Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
diff --git a/api/controller/toolchain.py b/api/controller/toolchain.py
index 96acd78..57ae7eb 100644
--- a/api/controller/toolchain.py
+++ b/api/controller/toolchain.py
@@ -353,7 +353,10 @@
 
   linter_findings = _fetch_clippy_lints(git_repo_path)
   linter_findings.extend(_fetch_tidy_lints(git_repo_path))
-  linter_findings = _filter_linter_findings(linter_findings, git_repo_path)
+
+  if input_proto.filter_modified:
+    linter_findings = _filter_linter_findings(linter_findings, git_repo_path)
+
   output_proto.findings.extend(linter_findings)
 
 
@@ -364,7 +367,7 @@
 
 
 def _filter_linter_findings(findings, git_repo_path):
-  """Filters a findings to keep only those concerning modified lines."""
+  """Filters findings to keep only those concerning modified lines."""
   new_findings = []
   new_lines = _get_added_lines({git_repo_path: 'HEAD'})
   for finding in findings: