{"id":16965006,"url":"https://github.com/propensive/fulminate","last_synced_at":"2025-04-05T15:46:07.810Z","repository":{"id":185942892,"uuid":"674366461","full_name":"propensive/fulminate","owner":"propensive","description":"Rich user messages for Scala","archived":false,"fork":false,"pushed_at":"2025-02-11T21:20:21.000Z","size":3103,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T20:49:18.038Z","etag":null,"topics":["error-messages","markup","rich-messages","scala"],"latest_commit_sha":null,"homepage":"https://soundness.dev/fulminate/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/propensive.png","metadata":{"files":{"readme":".github/readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-03T19:16:06.000Z","updated_at":"2025-02-11T21:20:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d8e0e37-e998-477e-9c5e-230ddeaade22","html_url":"https://github.com/propensive/fulminate","commit_stats":null,"previous_names":["propensive/fulminate"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Ffulminate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Ffulminate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Ffulminate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Ffulminate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/propensive","download_url":"https://codeload.github.com/propensive/fulminate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361598,"owners_count":20926642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-messages","markup","rich-messages","scala"],"created_at":"2024-10-13T23:44:49.005Z","updated_at":"2025-04-05T15:46:07.803Z","avatar_url":"https://github.com/propensive.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg alt=\"GitHub Workflow\" src=\"https://img.shields.io/github/actions/workflow/status/propensive/fulminate/main.yml?style=for-the-badge\" height=\"24\"\u003e](https://github.com/propensive/fulminate/actions)\n[\u003cimg src=\"https://img.shields.io/discord/633198088311537684?color=8899f7\u0026label=DISCORD\u0026style=for-the-badge\" height=\"24\"\u003e](https://discord.com/invite/MBUrkTgMnA)\n\u003cimg src=\"/doc/images/github.png\" valign=\"middle\"\u003e\n\n# Fulminate\n\n__Rich and composable error messages__\n\nWhile plain text is a sufficient medium for communicating with users (whether\nthey be other programmers, or end-users), it lacks a versatile way of marking\nup parts of the text in a way that could be rendered in different ways as\nmarkdown, HTML or console text: usually, it's necessary to commit early to\nthe output format. _Fulminate_ fills this gap by providing a convenient\nrepresentation of a message, with constructors which automatically contrast\nthe dynamic parts of the message from the static parts.\n\n## Features\n\n- rich representation of user-facing messages, particularly for errors\n- demarcation of fixed and variable parts of a message\n- provides a general-purpose `Error` type for immutable exception objects\n\n\n## Availability\n\nFulminate has not yet been published. The medium-term plan is to build it with\n[Fury](https://github.com/propensive/fury) and to publish it as a source build\non [Vent](https://github.com/propensive/vent). This will enable ordinary users\nto write and build software which depends on Fulminate.\n\nSubsequently, Fulminate will also be made available as a binary in the Maven\nCentral repository. This will enable users of other build tools to use it.\n\nFor the overeager, curious and impatient, see [building](#building).\n\n\n\n\n\n\n## Getting Started\n\n### `Message`s\n\nA `Message` is a string of text which may have other `Message`s embedded within\nit. Unlike a string, though, `Message`s retain their structure, and references\nto the embedded `Message`s are retained, unchanged.\n\nThe simplest way to construct a `Message` is with the `msg\"\"` interpolator, for example:\n```scala\nval message = msg\"this is a message\"\n```\n\nSuch a message can be embedded within another, as in,\n```scala\nval message2 = msg\"We can see that $message.\"\n```\nwhich would represent the text, `We can see that this is a message.`.\n\nThis exact text can be produced by calling `Message`'s `text` method, but this\nflattens the structure of the message. Other libraries, such as\n[Punctuation](https://github.com/propensive/punctuation/),\n[Honeycomb](https://github.com/propensive/honeycomb/) and\n[Escapade](https://github.com/propensive/escapade/) can render `Message`s as\nricher presentations of text, such as Markdown, HTML and console output, and in\ndoing so, can highlight those parts of the `Message` which were embedded.\n\nThe `msg\"\"` interpolator also allows other types to be embedded, provided an\n`MessageShow` typeclass instance exists for that type. By default, that includes\nprimitive types, `Text` strings and any type for which a `Show` typeclass\ninstance exists, all of which will be automatically converted to `Message`s\nwhen they are substituted into the interpolator. While the `Message` that gets\nprovided by an `MessageShow` instance may be essentially the same as the `Text`\nthat is provided by a `Show` instance in most cases, `MessageShow` can provide\nadditional structure to the text content, that becomes apparent when rendered\nas Markdown, HTML or console text.\n\n### `Error`s\n\nAn `Error` is a subclass of `java.lang.Exception`, not be confused with\n`java.lang.Error`, whose error message is expressed as a `Message`.\n\nThis will typically be subclassed with a case class whose parameters will be\nsubstituted into the message, for example:\n```scala\ncase class SizeError(expected: Size, actual: Size)\nextends Error(msg\"expected a size $expected, but the actual size was $actual\")\n```\n\nThis would require an appropriate `MessageShow[Size]` (or a `Show[Size]`)\ninstance in scope for the substitution to be acceptable.\n\n### `fail`\n\nWhen writing macros, with a `Quotes` instance in scope, the `fail` method takes\na `Message` and will produce a compile error showing that message.\n\nIf the compiler is running in a terminal with color capability, then color will\nbe used to highlight embeddings in the failure message, by including ANSI\nescape codes in the output message.\n\nCalling `fail` requires a contextual `Realm` in scope. A `Realm` does nothing\nmore than to give a name to the scope for communication, and can be created with:\n```scala\ngiven Realm = realm\"myproject\"\n```\n\n### `Panic`\n\nSometimes we need to raise exceptions which are not intended to be handled, and\nnot even intended to be thrown, for example when a code branch is run which\nshould be impossible to reach. The `Panic` class provides a standard way of\nhandling such situation, and takes a `Message` parameter which should briefly\nexplain the reason why the situation was believed to be impossible.\n\nShould a `Panic` be thrown, it should represent a programming mistake: the\nmanifestation of a misconception of impossibility on the part of the\nprogrammer.\n\n\n\n\n\n## Status\n\nFulminate is classified as __maturescent__. For reference, Soundness projects are\ncategorized into one of the following five stability levels:\n\n- _embryonic_: for experimental or demonstrative purposes only, without any guarantees of longevity\n- _fledgling_: of proven utility, seeking contributions, but liable to significant redesigns\n- _maturescent_: major design decisions broady settled, seeking probatory adoption and refinement\n- _dependable_: production-ready, subject to controlled ongoing maintenance and enhancement; tagged as version `1.0.0` or later\n- _adamantine_: proven, reliable and production-ready, with no further breaking changes ever anticipated\n\nProjects at any stability level, even _embryonic_ projects, can still be used,\nas long as caution is taken to avoid a mismatch between the project's stability\nlevel and the required stability and maintainability of your own project.\n\nFulminate is designed to be _small_. Its entire source code currently consists\nof 234 lines of code.\n\n## Building\n\nFulminate will ultimately be built by Fury, when it is published. In the\nmeantime, two possibilities are offered, however they are acknowledged to be\nfragile, inadequately tested, and unsuitable for anything more than\nexperimentation. They are provided only for the necessity of providing _some_\nanswer to the question, \"how can I try Fulminate?\".\n\n1. *Copy the sources into your own project*\n   \n   Read the `fury` file in the repository root to understand Fulminate's build\n   structure, dependencies and source location; the file format should be short\n   and quite intuitive. Copy the sources into a source directory in your own\n   project, then repeat (recursively) for each of the dependencies.\n\n   The sources are compiled against the latest nightly release of Scala 3.\n   There should be no problem to compile the project together with all of its\n   dependencies in a single compilation.\n\n2. *Build with [Wrath](https://github.com/propensive/wrath/)*\n\n   Wrath is a bootstrapping script for building Fulminate and other projects in\n   the absence of a fully-featured build tool. It is designed to read the `fury`\n   file in the project directory, and produce a collection of JAR files which can\n   be added to a classpath, by compiling the project and all of its dependencies,\n   including the Scala compiler itself.\n   \n   Download the latest version of\n   [`wrath`](https://github.com/propensive/wrath/releases/latest), make it\n   executable, and add it to your path, for example by copying it to\n   `/usr/local/bin/`.\n\n   Clone this repository inside an empty directory, so that the build can\n   safely make clones of repositories it depends on as _peers_ of `fulminate`.\n   Run `wrath -F` in the repository root. This will download and compile the\n   latest version of Scala, as well as all of Fulminate's dependencies.\n\n   If the build was successful, the compiled JAR files can be found in the\n   `.wrath/dist` directory.\n\n## Contributing\n\nContributors to Fulminate are welcome and encouraged. New contributors may like\nto look for issues marked\n[beginner](https://github.com/propensive/fulminate/labels/beginner).\n\nWe suggest that all contributors read the [Contributing\nGuide](/contributing.md) to make the process of contributing to Fulminate\neasier.\n\nPlease __do not__ contact project maintainers privately with questions unless\nthere is a good reason to keep them private. While it can be tempting to\nrepsond to such questions, private answers cannot be shared with a wider\naudience, and it can result in duplication of effort.\n\n## Author\n\nFulminate was designed and developed by Jon Pretty, and commercial support and\ntraining on all aspects of Scala 3 is available from [Propensive\nO\u0026Uuml;](https://propensive.com/).\n\n\n\n## Name\n\nTo _fulminate_ is to express vehement protest, while _Fulminate_ provides the means to express protestations at errors.\n\nIn general, Soundness project names are always chosen with some rationale,\nhowever it is usually frivolous. Each name is chosen for more for its\n_uniqueness_ and _intrigue_ than its concision or catchiness, and there is no\nbias towards names with positive or \"nice\" meanings—since many of the libraries\nperform some quite unpleasant tasks.\n\nNames should be English words, though many are obscure or archaic, and it\nshould be noted how willingly English adopts foreign words. Names are generally\nof Greek or Latin origin, and have often arrived in English via a romance\nlanguage.\n\n## Logo\n\nThe logo shows a boiling, bubbling liquid; fulminating.\n\n## License\n\nFulminate is copyright \u0026copy; 2025 Jon Pretty \u0026 Propensive O\u0026Uuml;, and\nis made available under the [Apache 2.0 License](/license.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Ffulminate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpropensive%2Ffulminate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Ffulminate/lists"}