Skip to content

Commit bcd8a12

Browse files
authored
Command line functionality (flutter#17)
* Add command-line functionality to generate constants.
1 parent 88ec4ee commit bcd8a12

File tree

13 files changed

+1682
-122
lines changed

13 files changed

+1682
-122
lines changed

AUTHORS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
#
44
# Name/Organization <email address>
55

6-
Google Inc.
6+
Lasse R.H. Nielsen, https://github.com/lrhn
7+
Kevin Moore, https://github.com/kevmoo
8+
Phil Quitslund, https://github.com/pq
9+
Greg Lowe, https://github.com/xxgreg

CHANGELOG.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.2.0-nullsafety.2
2+
3+
- Add command line functionality to generate constants.
4+
Allows clients to generate their own constants instead of
5+
depending on the package at run-time.
6+
Example: To generate the characters needed
7+
for a hexadecimal numeral, run `pub run charcode a-fA-F\d+-`.
8+
19
## 1.2.0-nullsafety.1
210

311
- Allow 2.10 stable and 2.11.0 dev SDK versions.
@@ -8,17 +16,15 @@
816

917
## 1.1.3
1018

11-
- Added example, fixed recommended lints.
19+
- Added example, changed lints.
1220

1321
## 1.1.2
1422

1523
- Updated the SDK constraint.
1624

1725
## 1.1.1
1826

19-
- Spelling fixes.
20-
21-
- Linting fixes.
27+
- Spelling and linting fixes.
2228

2329
## 1.1.0
2430

CONTRIBUTING.md

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
1-
Want to contribute? Great! First, read this page (including the small print at
2-
the end).
3-
4-
### Before you contribute
5-
Before we can use your code, you must sign the
6-
[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual)
7-
(CLA), which you can do online. The CLA is necessary mainly because you own the
8-
copyright to your changes, even after your contribution becomes part of our
9-
codebase, so we need your permission to use and distribute your code. We also
10-
need to be sure of various other things—for instance that you'll tell us if you
11-
know that your code infringes on other people's patents. You don't have to sign
12-
the CLA until after you've submitted your code for review and a member has
13-
approved it, but you must do it before we can put your code into our codebase.
14-
15-
Before you start working on a larger contribution, you should get in touch with
16-
us first through the issue tracker with your idea so that we can help out and
17-
possibly guide you. Coordinating up front makes it much easier to avoid
18-
frustration later on.
19-
20-
### Code reviews
21-
All submissions, including submissions by project members, require review.
22-
23-
### File headers
24-
All files in the project must start with the following header.
25-
26-
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
27-
// for details. All rights reserved. Use of this source code is governed by a
28-
// BSD-style license that can be found in the LICENSE file.
29-
30-
### The small print
31-
Contributions made by corporations are covered by a different agreement than the
32-
one above, the
33-
[Software Grant and Corporate Contributor License Agreement](https://developers.google.com/open-source/cla/corporate).
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to this project,
4+
but any larger change should be discussed using the issue tracker
5+
before submitting a pull request.
6+
There are a few other guidelines you need to follow.
7+
8+
## Contributor License Agreement
9+
10+
Contributions to this project must be accompanied by a Contributor License
11+
Agreement. You (or your employer) retain the copyright to your contribution;
12+
this simply gives us permission to use and redistribute your contributions as
13+
part of the project. Head over to <https://cla.developers.google.com/> to see
14+
your current agreements on file or to sign a new one.
15+
16+
You generally only need to submit a CLA once, so if you've already submitted one
17+
(even if it was for a different project), you probably don't need to do it
18+
again.
19+
20+
## Code reviews
21+
22+
All submissions by non project members require review.
23+
We use GitHub pull requests for this purpose. Consult
24+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
25+
information on using pull requests.
26+
27+
## Community Guidelines
28+
29+
This project follows
30+
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).

README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,60 @@
1-
Character code constants.
1+
-[![Build Status](https://travis-ci.org/lrhn/charcode.svg?branch=master)](https://travis-ci.org/lrhn/charcode)
2+
-[![Pub](https://img.shields.io/pub/v/charcode.svg)](https://pub.dev/packages/charcode) -
23

3-
[![Build Status](https://travis-ci.org/dart-lang/charcode.svg?branch=master)](https://travis-ci.org/dart-lang/charcode)
4-
[![Pub](https://img.shields.io/pub/v/charcode.svg)](https://pub.dev/packages/charcode)
4+
# Character code constants
55

6-
These libraries define symbolic names for some character codes.
6+
This package defines symbolic names for some character codes (aka. code points).
77

8-
## Using
8+
They can used when working directly with characters as integers,
9+
to make the code more readable: `if (firstChar == $A) ...`.
910

10-
Import either one of the libraries:
11+
This is not an official Google package, and is not supported by Google.
12+
13+
## Usage
1114

15+
Import either one of the libraries:
1216
```dart
1317
import "package:charcode/ascii.dart";
1418
import "package:charcode/html_entity.dart";
1519
```
16-
1720
or import both libraries using the `charcode.dart` library:
18-
1921
```dart
2022
import "package:charcode/charcode.dart";
2123
```
2224

23-
# Naming
25+
## Naming
2426

2527
The character names are preceded by a `$` to avoid conflicting with other
26-
variables due to the short and common names (for example "$i").
28+
variables, due to their short and common names (for example "$i").
2729

28-
The characters that are valid in a Dart identifier directly follow the `$`.
30+
Characters that are valid in a Dart identifier directly follow the `$`.
2931
Examples: `$_`, `$a`, `$B` and `$3`. Other characters are given symbolic names.
3032

31-
The names of letters are lower-case for lower-case letters, and mixed- or
32-
upper-case for upper-case letters. The names of symbols are all lower-case,
33+
The names of letters are lower-case for lower-case letters (`$sigma` for `σ`),
34+
and mixed- or upper-case for upper-case letters (`$Sigma` for `Σ`).
35+
The names of symbols and punctuation are all lower-case,
3336
and omit suffixes like "sign", "symbol" and "mark".
34-
Examples: `$plus`, `$exclamation`
37+
Examples: `$plus`, `$exclamation`, `$tilde`.
3538

3639
The `ascii.dart` library defines a symbolic name for each ASCII character.
37-
For some characters, it has more than one name. For example the common `$tab`
38-
and the official `$ht` for the horizontal tab.
40+
Some characters have more than one name. For example the common name `$tab`
41+
and the official abbreviation `$ht` for the horisontal tab.
3942

4043
The `html_entity.dart` library defines a constant for each HTML 4.01 character
41-
entity, using the standard entity abbreviation, including its case.
44+
entity using their standard entity abbreviation, including case.
4245
Examples: `$nbsp` for `&nbps;`, `$aring` for the lower-case `&aring;`
4346
and `$Aring` for the upper-case `&Aring;`.
4447

45-
The HTML entities includes all characters in the Latin-1 code page, greek
48+
The HTML entities include all characters in the Latin-1 code page, greek
4649
letters and some mathematical symbols.
4750

48-
The `charcode.dart` library just exports both `ascii.dart` and
49-
`html_entity.dart`.
51+
The `charcode.dart` library exports both `ascii.dart` and
52+
`html_entity.dart`. Where both libraries define the same name,
53+
the HTML entity name is preferred.
5054

51-
# Rationale
55+
## Rationale
5256

53-
The Dart language doesn't have character literals. If that ever happens, this
54-
library will be irrelevant. Until then, this library can be used for the most
55-
common characters.
56-
See [request for character literals](http://dartbug.com/4415).
57+
The Dart language doesn't have character literals.
58+
If that ever changes, this package will become irrelevant.
59+
Until then, this package can be used for the most common characters.
60+
See [http://dartbug.com/4415](request for character literals).

analysis_options.yaml

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,12 @@
1-
include: package:pedantic/analysis_options.yaml
2-
analyzer:
3-
strong-mode:
4-
implicit-casts: false
1+
# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source is governed by a
3+
# BSD-style license that can be found in the LICENSE file.
54

5+
include: package:pedantic/analysis_options.1.9.0.yaml
6+
analyzer:
7+
errors:
8+
annotate_overrides: ignore
9+
prefer_single_quotes: ignore
10+
use_function_type_syntax_for_parameters: ignore
611
enable-experiment:
7-
- non-nullable
8-
9-
linter:
10-
rules:
11-
- avoid_empty_else
12-
- avoid_init_to_null
13-
- avoid_null_checks_in_equality_operators
14-
- avoid_unused_constructor_parameters
15-
- await_only_futures
16-
- camel_case_types
17-
- cancel_subscriptions
18-
- constant_identifier_names
19-
- control_flow_in_finally
20-
- directives_ordering
21-
- empty_catches
22-
- empty_constructor_bodies
23-
- empty_statements
24-
- hash_and_equals
25-
- implementation_imports
26-
- iterable_contains_unrelated_type
27-
- library_names
28-
- library_prefixes
29-
- list_remove_unrelated_type
30-
- non_constant_identifier_names
31-
- overridden_fields
32-
- package_api_docs
33-
- package_names
34-
- package_prefixed_library_names
35-
- prefer_equal_for_default_values
36-
- prefer_final_fields
37-
- prefer_generic_function_type_aliases
38-
- prefer_is_not_empty
39-
- slash_for_doc_comments
40-
- test_types_in_equals
41-
- throw_in_finally
42-
- type_init_formals
43-
- unnecessary_brace_in_string_interps
44-
- unnecessary_const
45-
- unnecessary_new
46-
- unrelated_type_equality_checks
47-
- valid_regexps
12+
- non-nullable

0 commit comments

Comments
 (0)