-
Notifications
You must be signed in to change notification settings - Fork 15
322 Notebook Executables #329
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
base: master
Are you sure you want to change the base?
Changes from 20 commits
12ed2d7
334bac3
33a293b
b5bf007
b17d286
57150b4
fbb6320
654cac7
3f3e425
f1d545b
857d3c4
814b5a4
ac36de2
9f999c1
cc631fe
085ea7e
8da6d22
51c2b4c
06b76e0
4dacffe
b61974a
114535e
bce7382
49e72aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
RavenMarQ marked this conversation as resolved.
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ Package: kaiaulu | |
Type: Package | ||
Title: Kaiaulu | ||
Version: 0.0.0.9700 | ||
Description: Kaiaulu is an R package and common interface that helps with understanding evolving software development communities, and the artifacts (gitlog, mailing list, files, etc.) which developers collaborate and communicate about. See Paradis et al., (2012) <doi:10.1007/978-3-031-15116-3_6>. | ||
Description: Kaiaulu is an R package and common interface that helps with understanding evolving software development communities, and the artifacts (gitlog, mailing list, files, etc.) which developers collaborate and communicate about. See Paradis et al., (2012) <doi:10.1007/978-3-031-15116-3_6>. | ||
Authors@R: c( | ||
person('Carlos', 'Paradis', role = c('aut', 'cre'), | ||
email = '[email protected]', | ||
|
@@ -21,6 +21,7 @@ Authors@R: c( | |
person('Anthony', 'Lau', role = c('ctb')), | ||
person('Sean', 'Sunoo', role = c('ctb')), | ||
person('Ian Jaymes', 'Iwata', role= c('ctb')), | ||
person('Raven', 'Quiddaoen', role= c('ctb')), | ||
person('Nicholas', 'Beydler', role = c('ctb')), | ||
person('Mark', 'Burgess', role = c('ctb')) | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/local/bin/Rscript | ||
|
||
require(kaiaulu, quietly = TRUE) | ||
require(data.table, quietly = TRUE) | ||
require(stringi, quietly = TRUE) | ||
require(gh, quietly = TRUE) | ||
require(yaml, quietly = TRUE) | ||
require(magrittr, quietly = TRUE) | ||
require(knitr, quietly = TRUE) | ||
require(cli, quietly = TRUE) | ||
|
||
doc <- " | ||
USAGE: | ||
depends.R (-h | -help) | ||
depends.R --version | ||
depends.R parse help | ||
depends.R parse <config_filepath.yml> <tool_filepath.yml> <project_github_url> <save_path> | ||
|
||
DESCRIPTION: | ||
Parses file dependencies using the Depends tool. | ||
|
||
OPTIONS: | ||
-h --help Show this screen. | ||
--version Show version. | ||
" | ||
|
||
arguments <- docopt::docopt(doc, version = 'Kaiaulu 0.0.0.9700') | ||
|
||
# Determine which function to run and save output | ||
if (arguments[["parse"]] & arguments[["help"]]) { | ||
cli::cli_alert_info("Parses a given GitHub project supplied by <project_github_url> and saves two tables at the specified folder <save_path> using Depends") | ||
} else if (arguments[["parse"]]) { | ||
tool <- parse_config(arguments[["<tool_filepath.yml>"]]) | ||
conf <- parse_config(arguments[["<config_filepath.yml>"]]) | ||
project_github_url <- arguments[["<project_github_url>"]] | ||
git_repo_path <- get_git_repo_path(conf) | ||
|
||
# Depends parameters | ||
depends_jar_path <- get_tool_project("depends", tool) | ||
language <- get_depends_code_language(conf) | ||
keep_dependencies_type <- get_depends_keep_dependencies_type(conf) | ||
|
||
# Filters | ||
file_extensions <- get_file_extensions(conf) | ||
substring_filepath <- get_substring_filepath(conf) | ||
|
||
# Output | ||
save_path <- arguments[["<save_path>"]] | ||
node_file <- paste0(save_path, "/node.csv") | ||
edge_file <- paste0(save_path, "/edge.csv") | ||
|
||
# Construct File Network | ||
project_github_url <- stri_split_regex(project_github_url,pattern="/")[[1]] | ||
owner <- project_github_url[length(project_github_url)-1] | ||
repo <- project_github_url[length(project_github_url)] | ||
language_distribution_byte <- unlist(gh("GET /repos/:owner/:repo/languages",owner=owner,repo=repo)) | ||
language_distribution_byte <- language_distribution_byte/sum(language_distribution_byte) | ||
format(round(language_distribution_byte, 2), nsmall = 2) | ||
|
||
result <- parse_dependencies(depends_jar_path,git_repo_path,language=language) # Parse Dependencies | ||
|
||
data.table::fwrite(result$nodes, node_file) | ||
data.table::fwrite(result$edgelist, edge_file) | ||
cli::cli_alert_success(paste0("Dependencies table was saved at: ", save_path)) | ||
} else if (arguments[["-h"]] || arguments[["--help"]]) { | ||
cli::cli_alert_info(doc) | ||
} else if (arguments[["--version"]]) { | ||
cli::cli_alert_info('Kaiaulu 0.0.0.9700') | ||
} else { | ||
stop("No/invalid option(s) provided.") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/local/bin/Rscript | ||
|
||
require(kaiaulu, quietly = TRUE) | ||
require(data.table, quietly = TRUE) | ||
require(magrittr, quietly = TRUE) | ||
require(knitr, quietly = TRUE) | ||
require(cli, quietly = TRUE) | ||
|
||
doc <- " | ||
USAGE: | ||
linemetrics.R (-h | -help) | ||
linemetrics.R --version | ||
linemetrics.R analyze help | ||
linemetrics.R analyze <config_filepath.yml> <tool_filepath.yml> <save_path> | ||
|
||
DESCRIPTION: | ||
Analyze line metrics using the SCC tool. | ||
|
||
OPTIONS: | ||
-h --help Show this screen. | ||
--version Show version. | ||
" | ||
|
||
arguments <- docopt::docopt(doc, version = 'Kaiaulu 0.0.0.9700') | ||
|
||
# Determine which function to run and save output | ||
if (arguments[["analyze"]] & arguments[["help"]]) { | ||
cli::cli_alert_info("Analyzes a project specified in the <config_filepath.yml> config file and returns a csv file designated by <save_path> using SCC") | ||
} else if (arguments[["parse"]]) { | ||
tool <- parse_config(arguments[["<tool_filepath.yml>"]]) | ||
conf <- parse_config(arguments[["<config_filepath.yml>"]]) | ||
scc_path <- get_tool_project("scc", tool) | ||
|
||
git_repo_path <- get_git_repo_path(conf) | ||
git_branch <- get_git_branches(conf)[1] | ||
|
||
# Filters | ||
file_extensions <- get_file_extensions(conf) | ||
substring_filepath <- get_substring_filepath(conf) | ||
|
||
# Output | ||
save_path <- arguments[["<save_path>"]] | ||
|
||
git_checkout(git_branch,git_repo_path) | ||
result <- parse_line_metrics(scc_path,git_repo_path) # Parse Dependencies | ||
|
||
data.table::fwrite(result, save_path) | ||
cli::cli_alert_success(paste0("Line metrics table was saved at: ", save_path)) | ||
} else if (arguments[["-h"]] || arguments[["--help"]]) { | ||
cli::cli_alert_info(doc) | ||
} else if (arguments[["--version"]]) { | ||
cli::cli_alert_info('Kaiaulu 0.0.0.9700') | ||
} else { | ||
stop("No/invalid option(s) provided.") | ||
} |
Uh oh!
There was an error while loading. Please reload this page.