Skip to content

A portable bash script that searches for all for all C-files that contain less than a specific percentage of commented lines and report the results.

License

Notifications You must be signed in to change notification settings

AbdelrhmanHamouda/comments_compliance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

comments_compliance

A portable bash script that searches for all for all C-files that contain less than a specific percentage of commented lines and report the results.

Script usage and parameter description

Syntax: comments_compliance.sh [-p <percentage>|x <.c|.cpp>|i|s|h] [path]. 
parameters:  
p     Set the percentage for comment-lines. The provided value should be from 0 to 100 (default is '30').  
x     Set the file extension to be checked (default is '.c').  
i     Inverts the operation. Meaning that the output will be for the files that match or exceed the defined percentage.  
s     Sort the output alphanumerically.  
h     Print this help.  
path  Set the path to be used (default is '$PWD').  
  
Usage example:  
./comments_compliance.sh -is -p 40 /project/directory. 
      This command will print all compliant '.c' files in the provided directory and sort the output alphanumerically.  

About

A portable bash script that searches for all for all C-files that contain less than a specific percentage of commented lines and report the results.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages