Skip to content

Commit

Permalink
Enable and fix some more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Mar 4, 2020
1 parent c2f830a commit c84b345
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 14 deletions.
17 changes: 17 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ analyzer:
linter:
rules:
- avoid_bool_literals_in_conditional_expressions
- avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_function_literals_in_foreach_calls
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_renaming_method_parameters
- avoid_returning_null_for_future
- avoid_returning_null_for_void
- avoid_returning_this
- avoid_single_cascade_in_expression_statements
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_types
- cancel_subscriptions
Expand All @@ -33,18 +37,29 @@ linter:
- join_return_with_assignment
- list_remove_unrelated_type
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_runtimeType_toString
- only_throw_errors
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_asserts_in_initializer_lists
- prefer_const_constructors
- prefer_expression_function_bodies
- prefer_final_locals
- prefer_function_declarations_over_variables
- prefer_initializing_formals
- prefer_inlined_adds
- prefer_interpolation_to_compose_strings
- prefer_is_not_operator
- prefer_null_aware_operators
- prefer_relative_imports
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- provide_deprecation_message
- sort_pub_dependencies
- test_types_in_equals
- throw_in_finally
- unnecessary_await_in_return
Expand All @@ -54,4 +69,6 @@ linter:
- unnecessary_null_aware_assignments
- unnecessary_parenthesis
- unnecessary_statements
- unnecessary_string_interpolations
- use_string_buffers
- void_checks
2 changes: 1 addition & 1 deletion lib/src/vector_math/vector2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class Vector2 implements Vector {

/// Normalize this. Returns length of vector before normalization.
/// DEPRECATED: Use [normalize].
@deprecated
@Deprecated('Use normalize() insteaed.')
double normalizeLength() => normalize();

/// Normalized copy of this.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/vector_math/vector3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class Vector3 implements Vector {

/// Normalize this. Returns length of vector before normalization.
/// DEPRCATED: Use [normalize].
@deprecated
@Deprecated('Use normalize() insteaed.')
double normalizeLength() => normalize();

/// Normalizes copy of this.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/vector_math/vector4.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class Vector4 implements Vector {

/// Normalizes this. Returns length of vector before normalization.
/// DEPRCATED: Use [normalize].
@deprecated
@Deprecated('Use normalize() insteaed.')
double normalizeLength() => normalize();

/// Normalizes copy of this.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/vector_math_64/vector2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class Vector2 implements Vector {

/// Normalize this. Returns length of vector before normalization.
/// DEPRECATED: Use [normalize].
@deprecated
@Deprecated('Use normalize() insteaed.')
double normalizeLength() => normalize();

/// Normalized copy of this.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/vector_math_64/vector3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class Vector3 implements Vector {

/// Normalize this. Returns length of vector before normalization.
/// DEPRCATED: Use [normalize].
@deprecated
@Deprecated('Use normalize() insteaed.')
double normalizeLength() => normalize();

/// Normalizes copy of this.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/vector_math_64/vector4.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class Vector4 implements Vector {

/// Normalizes this. Returns length of vector before normalization.
/// DEPRCATED: Use [normalize].
@deprecated
@Deprecated('Use normalize() insteaed.')
double normalizeLength() => normalize();

/// Normalizes copy of this.
Expand Down
6 changes: 4 additions & 2 deletions lib/src/vector_math_geometry/filters/color_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ class ColorFilter extends GeometryFilter {
MeshGeometry filter(MeshGeometry mesh) {
MeshGeometry output;
if (mesh.getAttrib('COLOR') == null) {
final attributes = <VertexAttrib>[...mesh.attribs]
..add(VertexAttrib('COLOR', 4, 'float'));
final attributes = <VertexAttrib>[
...mesh.attribs,
VertexAttrib('COLOR', 4, 'float'),
];
output = MeshGeometry.resetAttribs(mesh, attributes);
} else {
output = MeshGeometry.copy(mesh);
Expand Down
4 changes: 2 additions & 2 deletions lib/vector_math_geometry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ library vector_math_geometry;
import 'dart:math' as math;
import 'dart:typed_data';

import 'package:vector_math/vector_math.dart';
import 'package:vector_math/vector_math_lists.dart';
import 'vector_math.dart';
import 'vector_math_lists.dart';

part 'src/vector_math_geometry/mesh_geometry.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/vector_math_lists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ library vector_math_lists;

import 'dart:math' as math;
import 'dart:typed_data';
import 'package:vector_math/vector_math.dart';
import 'vector_math.dart';

part 'src/vector_math_lists/scalar_list_view.dart';
part 'src/vector_math_lists/vector_list.dart';
Expand Down
6 changes: 3 additions & 3 deletions tool/generate_vector_math_64.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import 'dart:io';

import 'package:path/path.dart' as p;

Future<Null> main() async {
Future<void> main() async {
await generateVectorMath64();

print('Generated vector_math_64');
}

Future<Null> generateVectorMath64() async {
Future<void> generateVectorMath64() async {
final Directory directory = Directory('lib/src/vector_math_64/');
final File libraryFile = File('lib/vector_math_64.dart');

Expand All @@ -37,7 +37,7 @@ Future<Null> generateVectorMath64() async {
}
}

Future<Null> _processFile(String inputFileName) async {
Future<void> _processFile(String inputFileName) async {
final File inputFile = File(inputFileName);

final String input = await inputFile.readAsString();
Expand Down

0 comments on commit c84b345

Please sign in to comment.