-
Notifications
You must be signed in to change notification settings - Fork 10
Add files report #139
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
Add files report #139
Conversation
codebasin/report.py
Outdated
return f"{x/10**6:.1f}M" | ||
elif digits <= 12: | ||
return f"{x/10**9:.1f}G" | ||
return "??????" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe *******
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 987692c.
if not isinstance(x, numbers.Integral): | ||
raise TypeError("x must be Integral") | ||
|
||
digits = len(str(x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use log10
instead LOL
Introduces a new files report that visualizes the entire code base as a tree with a format inspired by the "tree" utility. Information about the platforms and SLOC used by each node in the tree is printed similar to tree's "metafirst" output, in the format: [Platforms | Used SLOC / Total SLOC | Code Divergence | Code Utilization] Colors and formatting are all hard-coded in this initial version, but the long-term plan is to allow configuration via the .cbi/config file. Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
Listing out the column names in full allows us to convey what the meta-information shows more clearly than adding short column headers, and does not require any complicated justification/padding logic for the different columns. Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
Introduces a new files report that visualizes the entire code base as a tree with a format inspired by the "tree" utility.
Information about the platforms and SLOC used by each node in the tree is printed similar to tree's "metafirst" output, in the format:
Colors and formatting are all hard-coded in this initial version, but the long-term plan is to allow configuration via the .cbi/config file.
Related issues
N/A
Proposed changes
FileTree
object to represent a directory of files + associated platform information hierarchically.files
report that builds aFileTree
for aCodeBase
and prints a colored version to the terminal.FileTree
and associated functionality.@laserkelvin - I can only apologize for this being such a big diff... The feature proved really complicated to get right, and even after a bunch of refactoring I couldn't really find a good way to split things up for review. I completely understand if this takes you a while!
Here's an example of the current output: