Skip to content

Commit

Permalink
Merge pull request #747 from dart-lang:revAnalyzer
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 584569280
  • Loading branch information
copybara-github committed Nov 22, 2023
2 parents 9742a4e + c782918 commit 9f65bb3
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 23 deletions.
4 changes: 3 additions & 1 deletion pkgs/intl_translation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## 0.19.0-dev
## 0.19.0-wip
* Always generate null safe code, remove `null-safe` flag.
* Add example for `he` locale.
* MessageExtraction: add set of error codes to be ignored in analysis.
* Upgrade dependencies on `analyzer` and `lints`.
* Fix pubspec `repository` url.

## 0.18.1
* Update analyzer dependency to `5.2.0`.
Expand Down
2 changes: 2 additions & 0 deletions pkgs/intl_translation/bin/make_examples_const.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// BSD-style license that can be found in the LICENSE file.

/// Converts the examples parameter for Intl messages to be const.
library;

import 'dart:io';

import 'package:args/args.dart';
Expand Down
2 changes: 2 additions & 0 deletions pkgs/intl_translation/bin/rewrite_intl_messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
/// It takes as input a single source Dart file and rewrites any
/// Intl.message or related calls to automatically include the name and args
/// parameters and writes the result to stdout.
library;

import 'dart:io';

import 'package:args/args.dart';
Expand Down
2 changes: 2 additions & 0 deletions pkgs/intl_translation/lib/src/message_rewriter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/// Code to rewrite Intl.message calls adding the name and args parameters
/// automatically, primarily used by the transformer.
library;

import 'package:analyzer/dart/analysis/utilities.dart';

import '../extract_messages.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'message.dart';
/// Abstract class for messages with internal structure, representing the
/// main Intl.message call, plurals, and genders.
abstract class ComplexMessage extends Message {
ComplexMessage(parent) : super(parent);
ComplexMessage(super.parent);

/// When we create these from strings or from AST nodes, we want to look up
/// and set their attributes by string names, so we override the indexing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import 'message.dart';
class CompositeMessage extends Message {
List<Message> pieces;

CompositeMessage.withParent(parent)
: pieces = const [],
super(parent);
CompositeMessage.withParent(super.parent) : pieces = const [];
CompositeMessage(this.pieces, [super.parent]) {
for (var x in pieces) {
x.parent = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class Gender extends SubMessage {
/// clauses. Each clause is expected to be a list whose first element is a
/// variable name and whose second element is either a [String] or
/// a list of strings and [Message] or [VariableSubstitution].
Gender.from(String mainArgument, List clauses, [Message? parent])
: super.from(mainArgument, clauses, parent);
Gender.from(super.mainArgument, super.clauses, [super.parent]) : super.from();

Message? female;
Message? male;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import 'submessage.dart';

class Plural extends SubMessage {
Plural() : super.from('', [], null);
Plural.from(String mainArgument, List clauses, [Message? parent])
: super.from(mainArgument, clauses, parent);
Plural.from(super.mainArgument, super.clauses, [super.parent]) : super.from();

Message? zero;
Message? one;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class Select extends SubMessage {
/// clauses. Each clause is expected to be a list whose first element is a
/// variable name and whose second element is either a String or
/// a list of strings and [Message]s or [VariableSubstitution]s.
Select.from(String mainArgument, List clauses, [Message? parent])
: super.from(mainArgument, clauses, parent);
Select.from(super.mainArgument, super.clauses, [super.parent]) : super.from();

Map<String, Message> cases = <String, Message>{};

Expand Down
10 changes: 5 additions & 5 deletions pkgs/intl_translation/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: intl_translation
version: 0.19.0-dev
version: 0.19.0-wip
description: >-
Contains code to deal with internationalized/localized messages,
date and number formatting and parsing, bi-directional text, and
other internationalization issues.
repository: https://github.com/dart-lang/intl_translation
repository: https://github.com/dart-lang/i18n/tree/main/pkgs/intl_translation

environment:
sdk: '>=2.18.0 <3.0.0'
sdk: '>=2.19.0 <4.0.0'

dependencies:
analyzer: ^5.2.0
analyzer: ^6.3.0
args: ^2.0.0
dart_style: ^2.0.0
intl: ^0.18.0
path: ^1.0.0

dev_dependencies:
lints: ^2.0.0
lints: ^3.0.0
test: ^1.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.

/// An application using the code map messages.
library;

import 'package:intl/intl.dart';
import 'package:test/test.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@Timeout(Duration(seconds: 180))

/// Test for parsing the examples argument from an Intl.message call. Very
/// minimal so far.
@Timeout(Duration(seconds: 180))
library;

import 'dart:io';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/// extract_message.dart for the files sample_with_messages.dart and
/// part_of_sample_with_messages.dart and writing out hard-coded translations
/// for German and French locales.
library;

import 'dart:convert';
import 'dart:io';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@Timeout(Duration(seconds: 180))

/// A test for message extraction and code generation using generated
/// JSON rather than functions
@Timeout(Duration(seconds: 180))
library;

import 'package:test/test.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

@Timeout(Duration(seconds: 180))

/// A test for message extraction and code generation using generated
/// JSON rather than functions
@Timeout(Duration(seconds: 180))
library;

import 'package:test/test.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.part of sample;

part of sample;
part of 'sample_with_messages.dart';

class Person {
String name;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/intl_translation/test/two_components/component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/// A component which should have its own separate messages, with their own
/// translations.
library;

import 'package:intl/intl.dart';

import 'component_messages_all.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/// This is not actually related to the two components testing, but it's
/// convenient to put it here because there's already a hard-coded
/// message here.
library;

import 'package:intl/intl.dart';
import 'package:test/test.dart';

Expand Down
2 changes: 2 additions & 0 deletions pkgs/intl_translation/test/two_components/main_app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.

/// An application using the component
library;

import 'package:intl/intl.dart';
import 'package:test/test.dart';

Expand Down

0 comments on commit 9f65bb3

Please sign in to comment.