Current section

Files

Jump to
oaspec gleam.toml
Raw

gleam.toml

name = "oaspec"
version = "0.55.0"
target = "erlang"
description = "Generate Gleam code from OpenAPI 3.x specifications"
licences = ["MIT"]
repository = { type = "github", user = "nao1215", repo = "oaspec" }
internal_modules = ["oaspec/internal/**"]
[dependencies]
gleam_stdlib = ">= 0.44.0 and < 2.0.0"
gleam_json = ">= 3.0.0 and < 4.0.0"
glint = ">= 1.0.0 and < 2.0.0"
simplifile = ">= 2.0.0 and < 3.0.0"
yay = ">= 2.0.0 and < 3.0.0"
argv = ">= 1.0.0 and < 2.0.0"
gleam_regexp = ">= 1.0.0 and < 2.0.0"
filepath = ">= 1.1.0 and < 2.0.0"
[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
gleescript = ">= 1.0.0 and < 2.0.0"
glinter = ">= 2.14.0 and < 3.0.0"
[tools.glinter]
stats = true
warnings_as_errors = true
include = ["src/", "test/"]
# The executable test surface is now split into stage-specific modules, but
# the extracted support module still holds the legacy case bodies. Glinter's
# current analysis remains quadratic in module size, so keep that support file
# excluded while linting every smaller entrypoint module.
exclude = ["test/oaspec_support.gleam"]
# Every rule is set to "error" for the strictest configuration.
# function_complexity, module_complexity, unwrap_used and ffi_usage default
# to "off" inside glinter; enabling them here still reports any hits with
# severity "off" (they do not fail the build), but they are left in for
# visibility.
[tools.glinter.rules]
assert_ok_pattern = "error"
avoid_panic = "error"
avoid_todo = "error"
deep_nesting = "error"
discarded_result = "error"
division_by_zero = "error"
duplicate_import = "error"
echo = "error"
error_context_lost = "error"
ffi_usage = "error"
function_complexity = "error"
label_possible = "error"
missing_labels = "error"
missing_type_annotation = "error"
module_complexity = "error"
panic_without_message = "error"
prefer_guard_clause = "error"
redundant_case = "error"
short_variable_name = "error"
string_inspect = "error"
stringly_typed_error = "error"
thrown_away_error = "error"
todo_without_message = "error"
trailing_underscore = "error"
unnecessary_string_concatenation = "error"
unnecessary_variable = "error"
unqualified_import = "error"
unused_exports = "error"
unwrap_used = "error"
# Per-file rule suppressions. Each entry lists rules that are intentionally
# ignored in that file; prefer fixing the underlying issue over expanding
# this list.
[tools.glinter.ignore]
# Public test functions are auto-discovered by gleeunit via reflection, so
# they legitimately look "unused" and lack explicit return annotations.
"test/*.gleam" = [
"unused_exports",
"missing_type_annotation",
"assert_ok_pattern",
"label_possible",
]
# Stage-specific wrapper modules intentionally delegate to shared support-case
# functions and ignore their heterogeneous return values; lint the case bodies
# themselves rather than forcing every wrapper call to pattern-match.
"test/oaspec_*_test.gleam" = ["discarded_result"]
# Codegen and OpenAPI traversal code takes many unlabelled helper
# parameters and is naturally branchy; fixing these cleanly would require a
# project-wide refactor that is out of scope for enabling glinter.
"src/oaspec/internal/cli.gleam" = ["label_possible", "deep_nesting"]
"src/oaspec/config.gleam" = ["label_possible"]
"src/oaspec/internal/capability.gleam" = ["label_possible"]
"src/oaspec/internal/formatter.gleam" = ["label_possible"]
"src/oaspec/generate.gleam" = ["label_possible", "deep_nesting"]
# schema_dispatch.gleam uses panic for unsupported inline complex schemas
# (object/allOf/oneOf/anyOf) in decoder/encoder dispatch — these patterns
# must fail fast instead of silently generating broken code (#290).
"src/oaspec/internal/codegen/*.gleam" = ["label_possible", "deep_nesting", "avoid_panic"]
"src/oaspec/codegen/writer.gleam" = ["label_possible"]
"src/oaspec/internal/openapi/*.gleam" = ["label_possible", "deep_nesting"]
"src/oaspec/openapi/parser.gleam" = ["label_possible", "deep_nesting"]
"src/oaspec/openapi/diagnostic.gleam" = ["label_possible"]
"src/oaspec/internal/util/*.gleam" = ["label_possible", "deep_nesting"]
# naming.gleam memoizes its three pre-compiled regexes via a tiny
# `oaspec_naming_ffi:memoize/2` helper backed by `persistent_term`.
# This is the only FFI in the project; the lint rule stays on
# everywhere else (Issue #405).
"src/oaspec/internal/util/naming.gleam" = ["label_possible", "deep_nesting", "ffi_usage"]