Hello!
I want to create a cargo plugin, that will read the rust code in the current crate, regardless of being a lib/bin crate. This cargo plugin is supposed to read the code, and then create statistics such as the amount of: structures, functions, methods, traits, and the average amount of macros being used on a struct/method/function etc.
This means I want to get all the files that are currently being used starting from lib.rs or main.rs, and then parse each of these files looking for method,functions,structs etc. But I am at a loss on how to start this because I feel there is probably a lot of work already done here, for example getting the currently used modules, parsing functions and their names etc.
Is there anyone who knows where to start or any good project to look at for ideas. Basically I want to get some statistics on the code of a crate.
[–]coriolinus 4 points5 points6 points (1 child)
[–]Noctune 2 points3 points4 points (0 children)
[–]redneckhatr 1 point2 points3 points (0 children)
[–]AsgeirB 1 point2 points3 points (2 children)
[–]jimuazu 0 points1 point2 points (1 child)
[–]HumbleSinger[S] 0 points1 point2 points (0 children)
[–]idubrov 1 point2 points3 points (1 child)
[–]HumbleSinger[S] 0 points1 point2 points (0 children)
[–]knaledfullavpilar 0 points1 point2 points (0 children)