Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: loc printer #1882

Merged
merged 6 commits into from
Jun 22, 2023
Merged

feat: loc printer #1882

merged 6 commits into from
Jun 22, 2023

Conversation

devtooligan
Copy link
Contributor

  • This pr adds a new printer: loc for metrics about lines of code.
INFO:Printers:Lines of Code
+------+-----+-----+------+
|      | src | dep | test |
+------+-----+-----+------+
| loc  |  21 |  0  |  0   |
| sloc |  11 |  0  |  0   |
| cloc |  5  |  0  |  0   |
+------+-----+-----+------+
  • The Human summary printer was also updated. Previously, the Human summary only reported total lines of code (LOC) but now it only reports SLOC. Also, it only displays information about Test and Dependency files if those type of files were found.

Before:

INFO:Printers:
Compiled with solc
Number of lines: 21 (+ 0 in dependencies, + 0 in tests)

After

INFO:Printers:
Compiled with solc
Source lines of code (SLOC) in source files: 11
  • A couple of utility files were added to easily convert dicts to MyPrettyTable

@devtooligan devtooligan marked this pull request as draft May 5, 2023 04:59
@devtooligan devtooligan marked this pull request as ready for review May 9, 2023 23:05
devtooligan and others added 3 commits May 11, 2023 10:59
- Remove the usage of dict and create LoC/LoCInfo dataclass to reduce complexity
- Add to_pretty_table in LoC to reduce complexity
- Use proper type (remove PEP 585 for python 3.8 support)
@montyly
Copy link
Member

montyly commented May 25, 2023

For visibility, I made the following changes:

  • Move LoC features into utils.loc as they are now used by two printers
  • Remove the usage of dict and create LoC/LoCInfo dataclass to reduce complexity
  • Add to_pretty_table in the LoC object to reduce complexity
  • Use proper type (remove PEP 585 for python 3.8 support)

@0xalpharush 0xalpharush added this to the 0.9.4 milestone Jun 20, 2023
@montyly montyly merged commit baf5948 into dev Jun 22, 2023
@montyly montyly deleted the loc-printer branch June 22, 2023 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants