Skip to content

Commit

Permalink
Improve scaladoc and teh README.md page
Browse files Browse the repository at this point in the history
  • Loading branch information
reidspencer committed Aug 15, 2024
1 parent 00cb051 commit 088671f
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 3 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)
[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/ossuminc/riddl/master/LICENSE)

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=bugs)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)

[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)

[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=ossuminc_riddl&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=ossuminc_riddl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ object AST {
}

/** A simple container for utility purposes in code. The parser never returns one of these */
@JSExport
case class SimpleContainer[+CV <: ContentValues](contents: Contents[CV]) extends Container[CV] {
def format: String = ""
def loc: At = At.empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,16 @@ object Messages {

@inline def toMessages: Messages = msgs.toList

/** Add an arbitrary [[Message]] to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@JSExport
def add(msg: Message): this.type = {
msg.kind match {
case Warning =>
Expand All @@ -379,46 +389,145 @@ object Messages {
this
}

/** Add a [[StyleWarning]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def style(message: String, loc: At = At.empty): this.type = {
add(Message(loc, message, StyleWarning))
}

/** Add an [[Info]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def info(message: String, loc: At = At.empty): this.type = {
add(Message(loc, message, Info))
}

/** Add a [[Warning]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def warning(message: String, loc: At = At.empty): this.type = {
add(Message(loc, message, Warning))
}

/** Add an [[Error]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def error(message: String, loc: At = At.empty): this.type = {
add(Message(loc, message, Error))
}

/** Add a [[SevereError]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def severe(message: String, loc: At = At.empty): this.type = {
add(Message(loc, message, SevereError))
}

/** Add a [[StyleWarning]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def addStyle(loc: At, msg: String): this.type = {
add(Message(loc, msg, StyleWarning))
}

/** Add a [[UsageWarning]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def addUsage(loc: At, msg: String): this.type = {
add(Message(loc, msg, UsageWarning))
}

/** Add a [[MissingWarning]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def addMissing(loc: At, msg: String): this.type = {
add(Message(loc, msg, MissingWarning))
}

/** Add a [[Warning]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def addWarning(loc: At, msg: String): this.type = {
add(Message(loc, msg, Warning))
}

/** Add an [[Error]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def addError(loc: At, msg: String): this.type = {
add(Message(loc, msg, Error))
}

/** Add a [[SevereError]] message to the accumulated [[Messages]]
*
* @param message
* The text of the message to add
* @param loc
* The location in the source related to the message.
* @return
* This type, so you can chain another call to this accumulator
*/
@inline def addSevere(loc: At, msg: String): this.type = {
add(Message(loc, msg, SevereError))
}
Expand Down

0 comments on commit 088671f

Please sign in to comment.