Skip to content

Commit

Permalink
♻️ refactor(analysis): enable ignored lints (#197)
Browse files Browse the repository at this point in the history
* ♻️ refactor(analysis): enable ignored lints

* ♻️ refactor(enharmonic_note): remove unwanted method

* ♻️ refactor(scale): add missing `@immutable` annotation
  • Loading branch information
albertms10 committed Jun 23, 2023
1 parent 1e19d0f commit f1706fe
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 4 deletions.
3 changes: 0 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,8 @@ analyzer:
- dart_code_metrics

errors:
avoid_equals_and_hash_code_on_mutable_classes: ignore
public_member_api_docs: ignore
unused_element: ignore # See https://github.com/dart-lang/sdk/issues/49025

# Style decisions
always_put_required_named_parameters_first: ignore
always_use_package_imports: ignore
sort_constructors_first: ignore
1 change: 1 addition & 0 deletions lib/src/harmony/chord.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
part of '../../music_notes.dart';

@immutable
class Chord<T extends Scalable<T>>
with Chordable<Chord<T>>
implements Transposable<Chord<T>> {
Expand Down
1 change: 1 addition & 0 deletions lib/src/harmony/chord_pattern.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
part of '../../music_notes.dart';

@immutable
class ChordPattern with Chordable<ChordPattern> {
/// The intervals from the root note.
final List<Interval> intervals;
Expand Down
1 change: 1 addition & 0 deletions lib/src/harmony/harmonic_function.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
part of '../../music_notes.dart';

@immutable
class HarmonicFunction {
final List<ScaleDegree> scaleDegrees;

Expand Down
1 change: 1 addition & 0 deletions lib/src/interval/enharmonic_interval.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

part of '../../music_notes.dart';

@immutable
final class EnharmonicInterval extends Enharmonic<Interval> {
const EnharmonicInterval(super.semitones);

Expand Down
1 change: 1 addition & 0 deletions lib/src/note/enharmonic_note.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
part of '../../music_notes.dart';

@immutable
final class EnharmonicNote extends Enharmonic<Note>
implements Scalable<EnharmonicNote> {
const EnharmonicNote(super.semitones)
Expand Down
1 change: 1 addition & 0 deletions lib/src/note/positioned_note.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
part of '../../music_notes.dart';

/// A note octave in the octave range.
@immutable
final class PositionedNote
implements Comparable<PositionedNote>, Scalable<PositionedNote> {
/// Which of the 12 notes inside the octave.
Expand Down
1 change: 1 addition & 0 deletions lib/src/scale/scale.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
part of '../../music_notes.dart';

@immutable
class Scale<T extends Scalable<T>> implements Transposable<Scale<T>> {
/// The [Scalable<T>] degrees that define this [Scale<T>].
final List<T> degrees;
Expand Down
1 change: 1 addition & 0 deletions lib/src/scale/scale_degree.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
part of '../../music_notes.dart';

@immutable
class ScaleDegree implements Comparable<ScaleDegree> {
final int ordinal;
final int inversion;
Expand Down
1 change: 1 addition & 0 deletions lib/src/scale/scale_pattern.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ part of '../../music_notes.dart';
/// A set of musical notes ordered by fundamental frequency or pitch.
///
/// See [Scale (music)](https://en.wikipedia.org/wiki/Scale_(music)).
@immutable
final class ScalePattern {
/// The interval steps that define this [ScalePattern].
final List<Interval> intervalSteps;
Expand Down
1 change: 0 additions & 1 deletion lib/src/transposable.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
part of '../music_notes.dart';

@immutable
// ignore: one_member_abstracts
abstract interface class Transposable<T> {
/// Returns a transposed [T] by [interval] from this [T].
Expand Down

0 comments on commit f1706fe

Please sign in to comment.