mirror of https://github.com/flutter/samples.git
Add command to travis CI to analyze if update-code-segments has been run for Flutter Gallery (#219)
* Add command to travis CI to analyze if update-code-segments has been runpull/224/head
parent
eea6f180ee
commit
00306723ba
@ -1,11 +0,0 @@
|
|||||||
# Files and directories created by pub
|
|
||||||
.dart_tool/
|
|
||||||
.packages
|
|
||||||
# Remove the following pattern if you wish to check in your lock file
|
|
||||||
pubspec.lock
|
|
||||||
|
|
||||||
# Conventional directory for build outputs
|
|
||||||
build/
|
|
||||||
|
|
||||||
# Directory created by dartdoc
|
|
||||||
doc/api/
|
|
@ -1,3 +0,0 @@
|
|||||||
## 1.0.0
|
|
||||||
|
|
||||||
- Initial version
|
|
@ -1,39 +0,0 @@
|
|||||||
# Defines a default set of lint rules enforced for
|
|
||||||
# projects at Google. For details and rationale,
|
|
||||||
# see https://github.com/dart-lang/pedantic#enabled-lints.
|
|
||||||
include: package:pedantic/analysis_options.yaml
|
|
||||||
|
|
||||||
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
|
|
||||||
# Uncomment to specify additional rules.
|
|
||||||
# linter:
|
|
||||||
# rules:
|
|
||||||
# - camel_case_types
|
|
||||||
|
|
||||||
analyzer:
|
|
||||||
# exclude:
|
|
||||||
# - path/to/excluded/files/**
|
|
||||||
|
|
||||||
linter:
|
|
||||||
rules:
|
|
||||||
- avoid_types_on_closure_parameters
|
|
||||||
- avoid_void_async
|
|
||||||
- await_only_futures
|
|
||||||
- camel_case_types
|
|
||||||
- cancel_subscriptions
|
|
||||||
- close_sinks
|
|
||||||
- constant_identifier_names
|
|
||||||
- control_flow_in_finally
|
|
||||||
- empty_statements
|
|
||||||
- hash_and_equals
|
|
||||||
- implementation_imports
|
|
||||||
- non_constant_identifier_names
|
|
||||||
- package_api_docs
|
|
||||||
- package_names
|
|
||||||
- package_prefixed_library_names
|
|
||||||
- test_types_in_equals
|
|
||||||
- throw_in_finally
|
|
||||||
- unnecessary_brace_in_string_interps
|
|
||||||
- unnecessary_getters_setters
|
|
||||||
- unnecessary_new
|
|
||||||
- unnecessary_statements
|
|
||||||
- directives_ordering
|
|
@ -1,12 +0,0 @@
|
|||||||
// Copyright 2019 The Flutter team. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import 'package:codeviewer_cli/segment_generator.dart';
|
|
||||||
|
|
||||||
main(List<String> arguments) {
|
|
||||||
writeSegments(
|
|
||||||
sourceDirectoryPath: '../gallery/lib/demos',
|
|
||||||
targetFilePath: '../gallery/lib/codeviewer/code_segments.dart',
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
name: codeviewer_cli
|
|
||||||
description: A command-line application to highlight dart source code.
|
|
||||||
|
|
||||||
environment:
|
|
||||||
sdk: '>=2.4.0 <3.0.0'
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
string_scanner: 1.0.5
|
|
||||||
|
|
||||||
dev_dependencies:
|
|
||||||
pedantic: 1.8.0
|
|
||||||
test: ^1.5.0
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright 2019 The Flutter team. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:args/args.dart';
|
||||||
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
|
import 'segment_generator.dart';
|
||||||
|
|
||||||
|
void main(List<String> arguments) {
|
||||||
|
final parser = ArgParser()
|
||||||
|
..addOption(
|
||||||
|
'target',
|
||||||
|
help: 'The file path for the output target file.',
|
||||||
|
defaultsTo: path.join(
|
||||||
|
Directory.current.path, 'lib', 'codeviewer', 'code_segments.dart'),
|
||||||
|
)
|
||||||
|
..addFlag(
|
||||||
|
'dry-run',
|
||||||
|
help: 'Write the output to stdout.',
|
||||||
|
);
|
||||||
|
final argResults = parser.parse(arguments);
|
||||||
|
|
||||||
|
writeSegments(
|
||||||
|
sourceDirectoryPath: path.join(Directory.current.path, 'lib', 'demos'),
|
||||||
|
targetFilePath: argResults['target'] as String,
|
||||||
|
isDryRun: argResults['dry-run'] as bool,
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in new issue