Skip to content
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

feat: change Group concept to Tags #37

Merged
merged 16 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion wdl-ast/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Fix ignoring comments in expressions ([#23](https://github.com/stjude-rust-labs/wdl/pull/23)).

### Changed

* Changes the singular `Group` feature of lint warnings to one or more `Tags` (#37, contributed by @a-frantz)

## 0.1.0 — 12-17-2023

### Added

* Adds the initial version of the crate.
* Adds the initial version of the crate.
10 changes: 5 additions & 5 deletions wdl-ast/src/v1/lint/matching_parameter_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use std::ops::Sub as _;
use nonempty::NonEmpty;
use wdl_core::concern::code;
use wdl_core::concern::lint;
use wdl_core::concern::lint::Group;
use wdl_core::concern::lint::Rule;
use wdl_core::concern::lint::TagSet;
use wdl_core::concern::Code;
use wdl_core::file::location::Located;
use wdl_core::file::Location;
Expand Down Expand Up @@ -56,7 +56,7 @@ impl<'a> MatchingParameterMeta {
lint::warning::Builder::default()
.code(self.code())
.level(lint::Level::Medium)
.group(lint::Group::Completeness)
.tags(TagSet::new(&[lint::Tag::Completeness]))
.push_location(location.clone())
.subject(format!(
"missing parameter meta within {}: {}",
Expand Down Expand Up @@ -89,7 +89,7 @@ impl<'a> MatchingParameterMeta {
lint::warning::Builder::default()
.code(self.code())
.level(lint::Level::Medium)
.group(lint::Group::Completeness)
.tags(TagSet::new(&[lint::Tag::Completeness]))
.push_location(location.clone())
.subject(format!(
"extraneous parameter meta within {}: {}",
Expand All @@ -108,8 +108,8 @@ impl<'a> Rule<&'a v1::Document> for MatchingParameterMeta {
Code::try_new(code::Kind::Warning, Version::V1, 3).unwrap()
}

fn group(&self) -> lint::Group {
Group::Completeness
fn tags(&self) -> lint::TagSet {
TagSet::new(&[lint::Tag::Completeness])
}

fn check(&self, tree: &'a v1::Document) -> lint::Result {
Expand Down
12 changes: 10 additions & 2 deletions wdl-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## Unreleased

### Added

* Adds `Clarity` and `Portability` tags (#37, contributed by @a-frantz)

### Changed

* Changes the singular `Group` feature of lint warnings to one or more `Tags` (#37, contributed by @a-frantz)

## 0.1.0 — 12-17-2023

### Added

* Adds the initial version of the crate.
* Adds the initial version of the crate.
24 changes: 12 additions & 12 deletions wdl-core/src/concern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ impl Concern {
/// ```
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand All @@ -72,7 +72,7 @@ impl Concern {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand All @@ -99,8 +99,8 @@ impl Concern {
/// ```
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand All @@ -126,7 +126,7 @@ impl Concern {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand All @@ -153,8 +153,8 @@ impl Concern {
/// ```
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand All @@ -180,7 +180,7 @@ impl Concern {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand All @@ -207,8 +207,8 @@ impl Concern {
/// ```
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand All @@ -234,7 +234,7 @@ impl Concern {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand All @@ -261,8 +261,8 @@ impl Concern {
/// ```
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand All @@ -288,7 +288,7 @@ impl Concern {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand All @@ -315,8 +315,8 @@ impl Concern {
/// ```
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand All @@ -342,7 +342,7 @@ impl Concern {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand Down
12 changes: 6 additions & 6 deletions wdl-core/src/concern/concerns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ impl Concerns {
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::concerns::Builder;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand Down Expand Up @@ -108,7 +108,7 @@ impl Concerns {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand Down Expand Up @@ -149,8 +149,8 @@ impl Concerns {
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::concerns::Builder;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand Down Expand Up @@ -179,7 +179,7 @@ impl Concerns {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand Down Expand Up @@ -220,8 +220,8 @@ impl Concerns {
/// use wdl_core::concern::code::Kind;
/// use wdl_core::concern::concerns::Builder;
/// use wdl_core::concern::lint;
/// use wdl_core::concern::lint::Group;
/// use wdl_core::concern::lint::Level;
/// use wdl_core::concern::lint::TagSet;
/// use wdl_core::concern::parse;
/// use wdl_core::concern::validation;
/// use wdl_core::concern::Code;
Expand Down Expand Up @@ -250,7 +250,7 @@ impl Concerns {
/// let warning = lint::warning::Builder::default()
/// .code(Code::try_new(Kind::Warning, Version::V1, 1)?)
/// .level(Level::High)
/// .group(Group::Style)
/// .tags(TagSet::new(&[lint::Tag::Style]))
/// .push_location(Location::Unplaced)
/// .subject("Hello, world!")
/// .body("A body.")
Expand Down
9 changes: 5 additions & 4 deletions wdl-core/src/concern/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ use nonempty::NonEmpty;
use crate::concern::Code;
use crate::file::location;

mod group;
mod level;
mod tag_set;
pub mod warning;

pub use group::Group;
pub use level::Level;
pub use tag_set::Tag;
pub use tag_set::TagSet;
pub use warning::Warning;

/// An unrecoverable error that occurs during linting.
Expand Down Expand Up @@ -75,8 +76,8 @@ pub trait Rule<E>: std::fmt::Debug + Sync {
/// Get the code for this lint rule.
fn code(&self) -> Code;

/// Get the lint group for this lint rule.
fn group(&self) -> Group;
/// Get the lint tags for this lint rule.
fn tags(&self) -> TagSet;

/// Checks the tree according to the implemented lint rule.
fn check(&self, tree: E) -> Result;
Expand Down
37 changes: 0 additions & 37 deletions wdl-core/src/concern/lint/group.rs

This file was deleted.

Loading
Loading