Skip to content

Commit

Permalink
refactor: add further linter rules in relation with const and final
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert Mañosa committed Dec 9, 2020
1 parent 5c2f663 commit 9139c38
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions analysis_options.yaml
@@ -1 +1,8 @@
include: package:pedantic/analysis_options.yaml

linter:
rules:
- prefer_const_constructors
- prefer_const_literals_to_create_immutables
- prefer_final_in_for_each
- prefer_final_locals
2 changes: 1 addition & 1 deletion lib/src/classes/music.dart
Expand Up @@ -6,7 +6,7 @@ abstract class Music {

/// [Set] of [EnharmonicNote]s that form the chromatic scale.
static final chromaticScale = {
for (int i = 1; i <= chromaticDivisions; i++)
for (var i = 1; i <= chromaticDivisions; i++)
EnharmonicNote.fromSemitones(i)
};

Expand Down
2 changes: 1 addition & 1 deletion lib/src/classes/note.dart
Expand Up @@ -29,7 +29,7 @@ class Note implements MusicItem {
return mode == Modes.Major
? note
: note.transposeBySemitones(
Interval(Intervals.Tercera, Qualities.Menor, descending: true)
const Interval(Intervals.Tercera, Qualities.Menor, descending: true)
.semitones,
accidental,
);
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Expand Up @@ -5,6 +5,9 @@ version: 0.1.0
author: albertms10
repository: https://github.com/albertms10/music_notes.git

environment:
sdk: '>=2.10.0 <3.0.0'

dependencies:
test: ^1.14.6

Expand Down

0 comments on commit 9139c38

Please sign in to comment.