|
1 | 1 | use code0_definition_reader::parser::DefinitionError;
|
2 | 2 | use code0_definition_reader::parser::Feature;
|
3 | 3 | use colored::*;
|
4 |
| -use tabled::{ |
5 |
| - Table, Tabled, |
6 |
| - settings::{Modify, Style, Width, object::Columns}, |
7 |
| -}; |
| 4 | +use tabled::{Table, Tabled, settings::Style}; |
8 | 5 | use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition};
|
9 | 6 |
|
10 | 7 | #[derive(Tabled)]
|
@@ -207,13 +204,7 @@ pub fn feature_table(feature: &Feature) {
|
207 | 204 | )
|
208 | 205 | .collect();
|
209 | 206 |
|
210 |
| - let table = Table::new(error_rows) |
211 |
| - .with(Style::rounded()) |
212 |
| - .with(Modify::new(Columns::single(0)).with(Width::wrap(5))) // Index column |
213 |
| - .with(Modify::new(Columns::single(1)).with(Width::wrap(15))) // Type column |
214 |
| - .with(Modify::new(Columns::single(2)).with(Width::wrap(20))) // Definition column |
215 |
| - .with(Modify::new(Columns::single(3)).with(Width::wrap(40))) // Error column |
216 |
| - .to_string(); |
| 207 | + let table = Table::new(error_rows).with(Style::rounded()).to_string(); |
217 | 208 | println!("{}", table.bright_red());
|
218 | 209 | } else {
|
219 | 210 | println!("{}", " No errors found!".bright_green());
|
@@ -275,13 +266,10 @@ pub fn error_table(features: &Vec<Feature>) {
|
275 | 266 |
|
276 | 267 | let table = Table::new(error_rows)
|
277 | 268 | .with(Style::rounded())
|
278 |
| - .with(Modify::new(Columns::single(0)).with(Width::wrap(5))) // Index column |
279 |
| - .with(Modify::new(Columns::single(1)).with(Width::wrap(15))) // Feature column |
280 |
| - .with(Modify::new(Columns::single(2)).with(Width::wrap(12))) // Type column |
281 |
| - .with(Modify::new(Columns::single(3)).with(Width::wrap(18))) // Definition column |
282 |
| - .with(Modify::new(Columns::single(4)).with(Width::wrap(35))) // Error column |
283 |
| - .to_string(); |
284 |
| - println!("{}", table.bright_red()); |
| 269 | + .to_string() |
| 270 | + .bright_red(); |
| 271 | + |
| 272 | + println!("{table}"); |
285 | 273 | } else {
|
286 | 274 | println!(
|
287 | 275 | "{}",
|
@@ -331,15 +319,7 @@ pub fn summary_table(features: &[Feature]) {
|
331 | 319 | .collect();
|
332 | 320 |
|
333 | 321 | if !summary_rows.is_empty() {
|
334 |
| - let table = Table::new(summary_rows) |
335 |
| - .with(Style::rounded()) |
336 |
| - .with(Modify::new(Columns::single(0)).with(Width::wrap(20))) // Feature name |
337 |
| - .with(Modify::new(Columns::single(1)).with(Width::wrap(12))) // Status |
338 |
| - .with(Modify::new(Columns::single(2)).with(Width::wrap(8))) // Errors |
339 |
| - .with(Modify::new(Columns::single(3)).with(Width::wrap(12))) // Flow Types |
340 |
| - .with(Modify::new(Columns::single(4)).with(Width::wrap(12))) // Data Types |
341 |
| - .with(Modify::new(Columns::single(5)).with(Width::wrap(18))) // Runtime Functions |
342 |
| - .to_string(); |
| 322 | + let table = Table::new(summary_rows).with(Style::rounded()).to_string(); |
343 | 323 |
|
344 | 324 | println!("{}", table.bright_blue());
|
345 | 325 | }
|
|
0 commit comments