DStyle
Documentation for DStyle.
DStyle.check_field_name_type_repetitionDStyle.check_function_name_lowercaseDStyle.check_index_from_lengthDStyle.check_kernel_function_barriersDStyle.check_module_type_camel_caseDStyle.check_mutating_function_bangDStyle.github_actions_badgeDStyle.github_actions_badgeDStyle.github_actions_workflowDStyle.install_github_actions!DStyle.readme_badgeDStyle.setup!DStyle.setup_github_actions_badge!DStyle.setupgithub!DStyle.test_allDStyle.test_allDStyle.test_index_from_lengthDStyle.test_kernel_function_barriers
DStyle.check_field_name_type_repetition — Method
check_field_name_type_repetition(source; file="<memory>")Checks struct fields and typed function arguments for repeated type names.
DStyle.check_function_name_lowercase — Method
check_function_name_lowercase(source; file="<memory>")Checks that function names use lowercase/squashed words. Constructors are exempt.
DStyle.check_index_from_length — Method
check_index_from_length(source; file="<memory>")Reports lines that index or iterate using bounds derived from length/size, for example for i in 1:length(x) or x[1:size(x, 1)].
DStyle.check_kernel_function_barriers — Method
check_kernel_function_barriers(source; file="<memory>", max_lines_from_signature=1)Checks each function ... end block and reports a violation when the first loop (for/while) appears more than max_lines_from_signature lines after the function signature.
DStyle.check_module_type_camel_case — Method
check_module_type_camel_case(source; file="<memory>")Checks that module and type declarations use UpperCamelCase.
DStyle.check_mutating_function_bang — Method
check_mutating_function_bang(source; file="<memory>")Checks that functions mutating at least one argument end with !.
DStyle.github_actions_badge — Method
github_actions_badge(repo; workflow_filename="dstyle.yml", label="DStyle", branch=nothing)Returns Markdown for a dynamic GitHub Actions badge for the provided repository owner/repo.
DStyle.github_actions_badge — Method
github_actions_badge(; repo=nothing, workflow_filename="dstyle.yml", label="DStyle", branch=nothing)Like github_actions_badge(repo; ...), but infers repo from ENV["GITHUB_REPOSITORY"] or your local git remote origin when omitted.
DStyle.github_actions_workflow — Method
github_actions_workflow(; name="DStyle", julia_version="1.11", paths=nothing, workflow_filename="dstyle.yml", package_url="https://github.com/D3MZ/DStyle.jl")Returns a GitHub Actions workflow YAML string that runs DStyle.test_all(...) on push and pull_request.
DStyle.install_github_actions! — Method
install_github_actions!(; workflow_path=".github/workflows/dstyle.yml", kwargs...)Installs a generated DStyle workflow file into your repository and returns the written path.
DStyle.readme_badge — Method
readme_badge(; paths=nothing, max_lines_from_signature=1, label="DStyle", style="flat-square", link=nothing)Builds a Shields.io badge snippet for README files using current DStyle check results. The badge message is pass when no violations exist; otherwise it is fail(<count>).
DStyle.setup! — Method
setup!(; kwargs...)Backward-compatible alias for setupgithub!().
DStyle.setup_github_actions_badge! — Method
setup_github_actions_badge!(; workflow_path=".github/workflows/dstyle.yml", repo=nothing, branch=nothing, kwargs...)One-shot setup helper: writes the DStyle GitHub Actions workflow and returns the dynamic badge markdown (with inferred repo unless explicitly provided). Returns a named tuple (workflow_path, repo, badge).
DStyle.setupgithub! — Method
setupgithub!(; kwargs...)One-call GitHub setup. Installs the DStyle GitHub Actions workflow and returns (workflow_path, repo, badge) for immediate README usage.
DStyle.test_all — Method
test_all(testtarget::Module; kernel_function_barriers=true, julia_index_from_length=true, paths=nothing)Aqua-style entrypoint. Runs style tests for testtarget using @testset. Use rule=false to disable a check, or pass a NamedTuple to configure check kwargs.
DStyle.test_all — Method
test_all(; paths=nothing, max_lines_from_signature=1, throw=true)Runs all currently implemented style checks over one or more Julia files.
DStyle.test_index_from_length — Method
test_index_from_length(paths; broken=false, show_details=!broken)Test that code does not index or iterate with length/size derived indices. Returns collected violations.
DStyle.test_kernel_function_barriers — Method
test_kernel_function_barriers(paths; max_lines_from_signature=1, broken=false, show_details=!broken)Test that no kernel-function-barrier violations exist in paths. Returns collected violations.