complexipy 0.3.1__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -119,7 +119,7 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
119
119
 
120
120
  [[package]]
121
121
  name = "complexipy"
122
- version = "0.3.1"
122
+ version = "0.3.2"
123
123
  dependencies = [
124
124
  "csv",
125
125
  "env_logger",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "complexipy"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  edition = "2021"
5
5
  authors = ["Robin Quintero <rohaquinlop301@gmail.com>"]
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: complexipy
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -100,7 +100,7 @@ complexipy path/to/directory -s desc # Use the -s option to set the sort orde
100
100
  If set to 0, the exit with error will be disabled.
101
101
  - `-o` or `--output`: Output the results to a CSV file, default is False. The
102
102
  filename will be `complexipy.csv` and will be saved in the invocation directory.
103
- - `-d` or `--detail`: Set the detail level, default is "normal". If set to "low"
103
+ - `-d` or `--details`: Set the detail level, default is "normal". If set to "low"
104
104
  will show only files or functions with complexity greater than the maximum
105
105
  complexity.
106
106
  - `-l` or `--level` Set the level of measurement, default is "function". If set
@@ -144,7 +144,7 @@ The cognitive complexity of the file is 1, and the output of the command
144
144
  `complexipy path/to/file.py` will be:
145
145
 
146
146
  ```txt
147
- ───────────────────────────── 🐙 complexipy 0.3.1 ──────────────────────────────
147
+ ───────────────────────────── 🐙 complexipy 0.3.2 ──────────────────────────────
148
148
  Summary
149
149
  ┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
150
150
  ┃ Path ┃ File ┃ Function ┃ Complexity ┃
@@ -82,7 +82,7 @@ complexipy path/to/directory -s desc # Use the -s option to set the sort orde
82
82
  If set to 0, the exit with error will be disabled.
83
83
  - `-o` or `--output`: Output the results to a CSV file, default is False. The
84
84
  filename will be `complexipy.csv` and will be saved in the invocation directory.
85
- - `-d` or `--detail`: Set the detail level, default is "normal". If set to "low"
85
+ - `-d` or `--details`: Set the detail level, default is "normal". If set to "low"
86
86
  will show only files or functions with complexity greater than the maximum
87
87
  complexity.
88
88
  - `-l` or `--level` Set the level of measurement, default is "function". If set
@@ -126,7 +126,7 @@ The cognitive complexity of the file is 1, and the output of the command
126
126
  `complexipy path/to/file.py` will be:
127
127
 
128
128
  ```txt
129
- ───────────────────────────── 🐙 complexipy 0.3.1 ──────────────────────────────
129
+ ───────────────────────────── 🐙 complexipy 0.3.2 ──────────────────────────────
130
130
  Summary
131
131
  ┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
132
132
  ┃ Path ┃ File ┃ Function ┃ Complexity ┃
@@ -28,7 +28,7 @@ import typer
28
28
  root_dir = Path(__file__).resolve().parent.parent
29
29
  app = typer.Typer(name="complexipy")
30
30
  console = Console()
31
- version = "0.3.1"
31
+ version = "0.3.2"
32
32
 
33
33
 
34
34
  @app.command()
@@ -32,7 +32,11 @@ def output_summary(
32
32
  table, has_success, total_complexity = create_table_function_level(
33
33
  files, max_complexity, details, sort
34
34
  )
35
- console.print(Align.center(table))
35
+
36
+ if details == DetailTypes.low and table.row_count < 1:
37
+ console.print(f"No {'file' if file_level else 'function'}{'s' if len(files) > 1 else ''} were found with complexity greater than {max_complexity}.")
38
+ else:
39
+ console.print(Align.center(table))
36
40
  console.print(f":brain: Total Cognitive Complexity in {path}: {total_complexity}")
37
41
 
38
42
  return has_success
@@ -82,7 +82,7 @@ complexipy path/to/directory -s desc # Use the -s option to set the sort orde
82
82
  If set to 0, the exit with error will be disabled.
83
83
  - `-o` or `--output`: Output the results to a CSV file, default is False. The
84
84
  filename will be `complexipy.csv` and will be saved in the invocation directory.
85
- - `-d` or `--detail`: Set the detail level, default is "normal". If set to "low"
85
+ - `-d` or `--details`: Set the detail level, default is "normal". If set to "low"
86
86
  will show only files or functions with complexity greater than the maximum
87
87
  complexity.
88
88
  - `-l` or `--level` Set the level of measurement, default is "function". If set
@@ -126,7 +126,7 @@ The cognitive complexity of the file is 1, and the output of the command
126
126
  `complexipy path/to/file.py` will be:
127
127
 
128
128
  ```txt
129
- ───────────────────────────── 🐙 complexipy 0.3.1 ──────────────────────────────
129
+ ───────────────────────────── 🐙 complexipy 0.3.2 ──────────────────────────────
130
130
  Summary
131
131
  ┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
132
132
  ┃ Path ┃ File ┃ Function ┃ Complexity ┃
File without changes
File without changes
File without changes
File without changes
File without changes