@@ -78,6 +78,7 @@ impl ValueEnum for LinesChangedOnly {
7878}
7979
8080impl LinesChangedOnly {
81+ /// Is the instance valid for under the given conditions/flags?
8182 pub fn is_change_valid ( & self , added_lines : bool , diff_chunks : bool ) -> bool {
8283 match self {
8384 LinesChangedOnly :: Off => true ,
@@ -164,20 +165,68 @@ impl Display for ThreadComments {
164165
165166/// A data structure to contain CLI options that relate to
166167/// clang-tidy or clang-format arguments.
168+ ///
169+ /// This struct is designed to be a thread-safe vehicle for common clang arguments and configurations.
167170#[ derive( Debug , Clone , Default ) ]
168171pub struct ClangParams {
172+ /// The clang-tidy checks to run.
173+ ///
174+ /// Format of this string follows the `-checks` argument of clang-tidy.
169175 pub tidy_checks : String ,
176+
177+ /// Focus on changed lines or entire files.
170178 pub lines_changed_only : LinesChangedOnly ,
179+
180+ /// An optional path to a compilation database, used for clang-tidy.
171181 pub database : Option < PathBuf > ,
182+
183+ /// Extra arguments to pass to clang-tidy.
184+ ///
185+ /// Format of these strings follows the `-extra-arg` argument of clang-tidy.
172186 pub extra_args : Vec < String > ,
187+
188+ /// An optional list of compilation units, used for clang-tidy.
189+ ///
190+ /// This can be set to None initially, but it will be populated by
191+ /// [`capture_clang_tools_output()`](crate::clang_tools::capture_clang_tools_output),
192+ /// if the [`Self::database`] is given [`Some`] valid value (and the
193+ /// compile_commands.json file is parsed successfully).
173194 pub database_json : Option < Vec < CompilationUnit > > ,
195+
196+ /// The clang-format style to use.
197+ ///
198+ /// Format of this string follows the `-style` argument of clang-format.
174199 pub style : String ,
200+
201+ /// An optional path to the clang-tidy executable.
202+ ///
203+ /// If [`Self::tidy_checks`] is not `-*`, then this will be populated by
204+ /// [`capture_clang_tools_output()`](crate::clang_tools::capture_clang_tools_output),
205+ /// regardless if this is given [`Some`] value.
175206 pub clang_tidy_command : Option < PathBuf > ,
207+
208+ /// An optional path to the clang-format executable.
209+ ///
210+ /// If [`Self::style`] is not an empty string, then this will be populated by
211+ /// [`capture_clang_tools_output()`](crate::clang_tools::capture_clang_tools_output),
212+ /// regardless if this is given [`Some`] value.
176213 pub clang_format_command : Option < PathBuf > ,
214+
215+ /// An optional [`FileFilter`] to exclude files only from clang-tidy analysis.
177216 pub tidy_filter : Option < FileFilter > ,
217+
218+ /// An optional [`FileFilter`] to exclude files only from clang-format analysis.
178219 pub format_filter : Option < FileFilter > ,
220+
221+ /// Assert this if preparing a PR review with clang-tidy advice.
179222 pub tidy_review : bool ,
223+
224+ /// Assert this if preparing a PR review with clang-format advice.
180225 pub format_review : bool ,
226+
227+ /// The root of the repository, used to locate relative file paths in processing.
228+ ///
229+ /// A project-specific cache folder is created in this path.
181230 pub repo_root : PathBuf ,
182231}
183232
@@ -237,14 +286,33 @@ impl From<&Cli> for ClangParams {
237286/// A struct to contain CLI options that relate to
238287/// [`RestClient.post_feedback()`](fn@crate::rest_api::RestClient.post_feedback()).
239288pub struct FeedbackInput {
289+ /// How thread comments are created or updated.
240290 pub thread_comments : ThreadComments ,
291+
292+ /// Whether to omit a "LGTM" type message.
241293 pub no_lgtm : bool ,
294+
295+ /// Whether to post a step summary comment.
242296 pub step_summary : bool ,
297+
298+ /// Whether to post file annotations.
243299 pub file_annotations : bool ,
300+
301+ /// The clang-format style to show in file annotations.
244302 pub style : String ,
303+
304+ /// Whether to post a PR review with clang-tidy suggestions/notes.
245305 pub tidy_review : bool ,
306+
307+ /// Whether to post a PR review with clang-format suggestions.
246308 pub format_review : bool ,
309+
310+ /// Should PR reviews be commentary?
311+ ///
312+ /// If false, reviews will approve or request changes.
247313 pub passive_reviews : bool ,
314+
315+ /// The root of the repository, used to locate relative file paths in processing.
248316 pub repo_root : PathBuf ,
249317}
250318
@@ -285,7 +353,7 @@ impl Default for FeedbackInput {
285353
286354#[ cfg( all( test, feature = "bin" ) ) ]
287355mod test {
288- #![ allow( clippy:: unwrap_used) ]
356+ #![ allow( clippy:: unwrap_used, clippy :: expect_used ) ]
289357
290358 use clap:: { Parser , ValueEnum } ;
291359
0 commit comments