Skip to content

Commit b9b6509

Browse files
Add linting for our documentation and fix existing errors.
1 parent e3b3374 commit b9b6509

16 files changed

+415
-202
lines changed

.markdownlint.rb

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Copyright 2019 Square Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# Configuring rules:
18+
# https://github.com/markdownlint/markdownlint/blob/master/docs/creating_styles.md
19+
# Rule list:
20+
# https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md
21+
22+
# Need to explicitly run all rules, so the per-rule configs below aren't used as an allowlist.
23+
all
24+
25+
# Increase default line length from 80 to 100.
26+
rule 'MD013', :line_length => 100, :code_blocks => false, :tables => false
27+
28+
# Enable inline HTML.
29+
exclude_rule 'MD033'
30+
31+
# Allow paragraphs that consiste entirely of emphasized text.
32+
exclude_rule 'MD036'
33+
34+
# Allow trailing question marks in headers.
35+
rule 'MD026', :punctuation => '.,;:!'
36+
37+
# Markdownlint can't handle mkdocs' code block tab syntax, so disable code block formatting.
38+
exclude_rule 'MD040'
39+
exclude_rule 'MD046'
40+
41+
# Don't care about blank lines surround fenced code blocks.
42+
exclude_rule 'MD031'
43+
44+
# Allow raw URLs.
45+
exclude_rule 'MD034'

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ matrix:
1717
- pip install mkdocs-material
1818
script:
1919
- mkdocs build
20+
# Ensure docs are formatted correctly.
21+
- language: ruby
22+
install:
23+
- gem install mdl
24+
script:
25+
- ./lint_docs.sh
2026
- language: android
2127
name: "Android"
2228
jdk: oraclejdk8

CODE_OF_CONDUCT.md

+24-25
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Open Source Code of Conduct
33

44
At Square, we are committed to contributing to the open source community and simplifying the process
55
of releasing and managing open source software. We’ve seen incredible support and enthusiasm from
6-
thousands of people who have already contributed to our projects — and we want to ensure our community
6+
thousands of people who have already contributed to our projects — and we want to ensure ourcommunity
77
continues to be truly open for everyone.
88

99
This code of conduct outlines our expectations for participants, as well as steps to reporting
@@ -12,28 +12,28 @@ expect our code of conduct to be honored.
1212

1313
Square’s open source community strives to:
1414

15-
* **Be open**: We invite anyone to participate in any aspect of our projects. Our community is
16-
open, and any responsibility can be carried by a contributor who demonstrates the required
17-
capacity and competence.
15+
* **Be open**: We invite anyone to participate in any aspect of our projects. Our community is
16+
open, and any responsibility can be carried by a contributor who demonstrates the required
17+
capacity and competence.
1818

19-
* **Be considerate**: People use our work, and we depend on the work of others. Consider users and
20-
colleagues before taking action. For example, changes to code, infrastructure, policy, and
21-
documentation may negatively impact others.
19+
* **Be considerate**: People use our work, and we depend on the work of others. Consider users and
20+
colleagues before taking action. For example, changes to code, infrastructure, policy, and
21+
documentation may negatively impact others.
2222

23-
* **Be respectful**: We expect people to work together to resolve conflict, assume good intentions,
24-
and act with empathy. Do not turn disagreements into personal attacks.
23+
* **Be respectful**: We expect people to work together to resolve conflict, assume good intentions,
24+
and act with empathy. Do not turn disagreements into personal attacks.
2525

26-
* **Be collaborative**: Collaboration reduces redundancy and improves the quality of our work. We
27-
strive for transparency within our open source community, and we work closely with upstream
28-
developers and others in the free software community to coordinate our efforts.
26+
* **Be collaborative**: Collaboration reduces redundancy and improves the quality of our work. We
27+
strive for transparency within our open source community, and we work closely with upstream
28+
developers and others in the free software community to coordinate our efforts.
2929

30-
* **Be pragmatic**: Questions are encouraged and should be asked early in the process to avoid
31-
problems later. Be thoughtful and considerate when seeking out the appropriate forum for your
32-
questions. Those who are asked should be responsive and helpful.
30+
* **Be pragmatic**: Questions are encouraged and should be asked early in the process to avoid
31+
problems later. Be thoughtful and considerate when seeking out the appropriate forum for your
32+
questions. Those who are asked should be responsive and helpful.
3333

34-
* **Step down considerately**: Members of every project come and go. When somebody leaves or
35-
disengages from the project, they should make it known and take the proper steps to ensure that
36-
others can pick up where they left off.
34+
* **Step down considerately**: Members of every project come and go. When somebody leaves or
35+
disengages from the project, they should make it known and take the proper steps to ensure that
36+
others can pick up where they left off.
3737

3838
This code is not exhaustive or complete. It serves to distill our common understanding of a
3939
collaborative, shared environment, and goals. We expect it to be followed in spirit as much as in
@@ -78,12 +78,12 @@ discretion.
7878

7979
In your report please include:
8080

81-
* Your contact information.
82-
* Names (real, nicknames, or pseudonyms) of any individuals involved. If there are additional
83-
witnesses, please include them as well.
84-
* Your account of what occurred, and if you believe the incident is ongoing. If there is a publicly
85-
available record (e.g. a mailing list archive or a public IRC logger), please include a link.
86-
* Any additional information that may be helpful.
81+
* Your contact information.
82+
* Names (real, nicknames, or pseudonyms) of any individuals involved. If there are additional
83+
witnesses, please include them as well.
84+
* Your account of what occurred, and if you believe the incident is ongoing. If there is a publicly
85+
available record (e.g. a mailing list archive or a public IRC logger), please include a link.
86+
* Any additional information that may be helpful.
8787

8888
After filing a report, a representative from the Square Code of Conduct committee will contact you
8989
personally. The committee will then review the incident, follow up with any additional questions,
@@ -93,7 +93,6 @@ Anyone asked to stop unacceptable behavior is expected to comply immediately. If
9393
engages in unacceptable behavior, the Square Code of Conduct committee may take any action they deem
9494
appropriate, up to and including a permanent ban from all of Square spaces without warning.
9595

96-
9796
[codeofconduct_at]: mailto:[email protected]
9897
[twitter_coc]: https://github.com/twitter/code-of-conduct/blob/master/code-of-conduct.md
9998
[ubuntu_coc]: https://ubuntu.com/community/code-of-conduct

CONTRIBUTING.md

-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ we use [Square's code style definitions][2].
1212
Before your code can be accepted into the project you must also sign the
1313
[Individual Contributor License Agreement (CLA)][1].
1414

15-
1615
[1]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1
1716
[2]: https://github.com/square/java-code-styles

README.md

+30-16
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
[![CocoaPods compatible](https://img.shields.io/cocoapods/v/Workflow.svg)](https://cocoapods.org/pods/Workflow)
55
[![Maven Central](https://img.shields.io/maven-central/v/com.squareup.workflow/workflow-core-jvm.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.squareup.workflow%22)
66

7-
An architecture that allows composable state machines to drive UI navigation and content, where the state machines are cleanly separated from UI code.
7+
An architecture that allows composable state machines to drive UI navigation and content, where the
8+
state machines are cleanly separated from UI code.
89

910
_**This project is currently experimental and the API subject to breaking changes without notice.**
10-
Follow Square's engineering blog, [The Corner](https://developer.squareup.com/blog/), to see when this project becomes stable._
11+
Follow Square's engineering blog, [The Corner](https://developer.squareup.com/blog/), to see when
12+
this project becomes stable._
1113

1214
Workflow is a library for making composable state machines, and UIs driven by those state machines.
1315

14-
This project is under active development. The workflow code is being piloted in production apps. The view code is not (yet).
16+
This project is under active development. The workflow code is being piloted in production apps. The
17+
view code is not (yet).
1518

1619
More documentation and samples will be coming soon!
1720

@@ -21,7 +24,8 @@ More documentation and samples will be coming soon!
2124

2225
[![CocoaPods compatible](https://img.shields.io/cocoapods/v/Workflow.svg)](https://cocoapods.org/pods/Workflow)
2326

24-
If you use CocoaPods to manage your dependencies, simply add Workflow and WorkflowUI to your Podfile:
27+
If you use CocoaPods to manage your dependencies, simply add Workflow and WorkflowUI to your
28+
Podfile:
2529

2630
```ruby
2731
pod 'Workflow'
@@ -32,7 +36,8 @@ pod 'WorkflowUI'
3236

3337
[![Maven Central](https://img.shields.io/maven-central/v/com.squareup.workflow/workflow-core-jvm.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.squareup.workflow%22)
3438

35-
Artifacts are hosted on Maven Central. If you're using Gradle, ensure `mavenCentral()` appears in your `repositories` block, and then add dependencies on the following artifacts:
39+
Artifacts are hosted on Maven Central. If you're using Gradle, ensure `mavenCentral()` appears in
40+
your `repositories` block, and then add dependencies on the following artifacts:
3641

3742
<table>
3843
<tr>
@@ -41,7 +46,8 @@ Artifacts are hosted on Maven Central. If you're using Gradle, ensure `mavenCent
4146
</tr>
4247
<tr>
4348
<td nowrap><code>com.squareup.workflow:workflow-core-jvm:x.y.z</code></td>
44-
<td>You are writing a library module/project that uses Workflows, but you don't need to interact with the runtime from the outside.</td>
49+
<td>You are writing a library module/project that uses Workflows, but you don't need to interact
50+
with the runtime from the outside.</td>
4551
</tr>
4652
<tr>
4753
<td nowrap><code>com.squareup.workflow:workflow-rx2:x.y.z</code></td>
@@ -59,7 +65,8 @@ Artifacts are hosted on Maven Central. If you're using Gradle, ensure `mavenCent
5965

6066
#### Lower-level Artifacts
6167

62-
Most code shouldn't need to depend on these directly. They should generally only be used to build higher-level integrations with UI frameworks.
68+
Most code shouldn't need to depend on these directly. They should generally only be used to build
69+
higher-level integrations with UI frameworks.
6370

6471
<table>
6572
<tr>
@@ -72,25 +79,32 @@ Most code shouldn't need to depend on these directly. They should generally only
7279
</tr>
7380
<tr>
7481
<td nowrap><code>com.squareup.workflow:workflow-ui-core-jvm:x.y.z</code></td>
75-
<td>You are writing workflow-ui-android for another UI framework. Defines the core types used by that artifact.</td>
82+
<td>You are writing workflow-ui-android for another UI framework. Defines the core types used by
83+
that artifact.</td>
7684
</tr>
7785
</table>
7886

7987
## Resources
8088

81-
* [SF Android GDG @ Square 2019 - Hello Workflow](https://www.youtube.com/watch?v=8PlYtfsgDKs) (live coding)
82-
* [Android Dialogs 5-part Coding Series](https://twitter.com/chiuki/status/1100810374410956800)
83-
* [1](https://www.youtube.com/watch?v=JJ4-8AR5HhA), [2](https://www.youtube.com/watch?v=XB6frWBGvp0), [3](https://www.youtube.com/watch?v=NdFJMkT-t3c), [4](https://www.youtube.com/watch?v=aRxmyO6fwSs), [5](https://www.youtube.com/watch?v=aKaZa-1KN2M)
84-
* [Reactive Workflows a Year Later – Droidcon NYC 2018](https://www.youtube.com/watch?v=cw9ZF9-ilac)
85-
* [The Reactive Workflow Pattern – Fragmented Podcast](https://www.youtube.com/watch?v=mUBXgYnT7w0)
86-
* [The Reactive Workflow Pattern Update – Droidcon SF 2017](https://www.youtube.com/watch?v=mvBVkU2mCF4)
87-
* [The Rx Workflow Pattern – Droidcon NYC 2017](https://www.youtube.com/watch?v=KjoMnsc2lPo) ([slides](https://speakerdeck.com/rjrjr/reactive-workflows))
89+
* [SF Android GDG @ Square 2019 - Hello Workflow](https://www.youtube.com/watch?v=8PlYtfsgDKs)
90+
(live coding)
91+
* [Android Dialogs 5-part Coding Series](https://twitter.com/chiuki/status/1100810374410956800)
92+
* [1](https://www.youtube.com/watch?v=JJ4-8AR5HhA),
93+
[2](https://www.youtube.com/watch?v=XB6frWBGvp0),
94+
[3](https://www.youtube.com/watch?v=NdFJMkT-t3c),
95+
[4](https://www.youtube.com/watch?v=aRxmyO6fwSs),
96+
[5](https://www.youtube.com/watch?v=aKaZa-1KN2M)
97+
* [Reactive Workflows a Year Later – Droidcon NYC 2018](https://www.youtube.com/watch?v=cw9ZF9-ilac)
98+
* [The Reactive Workflow Pattern – Fragmented Podcast](https://www.youtube.com/watch?v=mUBXgYnT7w0)
99+
* [The Reactive Workflow Pattern Update – Droidcon SF 2017](https://www.youtube.com/watch?v=mvBVkU2mCF4)
100+
* [The Rx Workflow Pattern – Droidcon NYC 2017](https://www.youtube.com/watch?v=KjoMnsc2lPo)
101+
([slides](https://speakerdeck.com/rjrjr/reactive-workflows))
88102

89103
## Releasing and Deploying
90104

91105
See [RELEASING.md](RELEASING.md).
92106

93-
# License
107+
## License
94108

95109
<pre>
96110
Copyright 2019 Square Inc.

RELEASING.md

+43-39
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44

55
---
66

7-
***Before you begin:*** *Please make sure you are set up with [`pod trunk`](https://guides.cocoapods.org/making/getting-setup-with-trunk.html) and your CocoaPods account is a contributor to both the Workflow and WorkflowUI pods. If you need to be added as a contributor, please [open a ticket requesting access](https://github.com/square/workflow/issues/new), and assign it to @apgar or @timdonnelly.*
7+
***Before you begin:*** *Please make sure you are set up with
8+
[`pod trunk`](https://guides.cocoapods.org/making/getting-setup-with-trunk.html) and your CocoaPods
9+
account is a contributor to both the Workflow and WorkflowUI pods. If you need to be added as a
10+
contributor, please [open a ticket requesting access](https://github.com/square/workflow/issues/new),
11+
and assign it to @apgar or @timdonnelly.*
812

913
---
10-
1114
1. Merge an update of [the change log](CHANGELOG.md) with the changes since the last release.
1215

1316
1. Make sure you're on the `master` branch (or fix branch, e.g. `v0.1-fixes`).
@@ -17,70 +20,71 @@
1720
(cd kotlin && ./gradlew build connectedCheck)
1821
```
1922

20-
2. In `kotlin/gradle.properties`, remove the `-SNAPSHOT` prefix from the `VERSION_NAME` property.
23+
1. In `kotlin/gradle.properties`, remove the `-SNAPSHOT` prefix from the `VERSION_NAME` property.
2124
E.g. `VERSION_NAME=0.1.0`
2225

23-
3. Create a commit and tag the commit with the version number:
26+
1. Create a commit and tag the commit with the version number:
2427
```bash
2528
git commit -am "Releasing v0.1.0."
2629
git tag v0.1.0
2730
```
2831

29-
4. Upload the kotlin artifacts:
32+
1. Upload the kotlin artifacts:
3033
```bash
3134
(cd kotlin && ./gradlew clean build && ./gradlew uploadArchives --no-parallel --no-daemon)
3235
```
3336

34-
Disabling parallelism and daemon sharing is required by the vanniktech maven publish plugin. Without those,
35-
the artifacts will be split across multiple (invalid) staging repositories.
37+
Disabling parallelism and daemon sharing is required by the vanniktech maven publish plugin.
38+
Without those, the artifacts will be split across multiple (invalid) staging repositories.
3639

37-
5. Publish to CocoaPods:
40+
1. Publish to CocoaPods:
3841
```bash
3942
bundle exec pod trunk push Workflow.podspec
4043
bundle exec pod trunk push WorkflowUI.podspec
4144
```
4245

43-
6. Bump the version
44-
- **Kotlin:** Update the `VERSION_NAME` property in `kotlin/gradle.properties` to the new snapshot
45-
version, e.g. `VERSION_NAME=0.2.0-SNAPSHOT`.
46-
- **Swift:** Update `s.version` in `*.podspec` to the new version, e.g. `0.2.0`.
46+
1. Bump the version
47+
- **Kotlin:** Update the `VERSION_NAME` property in `kotlin/gradle.properties` to the new
48+
snapshot version, e.g. `VERSION_NAME=0.2.0-SNAPSHOT`.
49+
- **Swift:** Update `s.version` in `*.podspec` to the new version, e.g. `0.2.0`.
4750

48-
7. Commit the new snapshot version:
51+
1. Commit the new snapshot version:
4952
```
5053
git commit -am "Finish releasing v0.1.0."
5154
```
5255
53-
8. Push your commits and tag:
56+
1. Push your commits and tag:
5457
```
5558
git push origin master
5659
# or git push origin fix-branch
5760
git push origin v0.1.0
5861
```
5962
60-
9. Create the release on GitHub:
61-
1. Go to the [Releases](https://github.com/square/workflow/releases) page for the GitHub project.
62-
2. Click "Draft a new release".
63-
3. Enter the tag name you just pushed.
64-
4. Title the release with the same name as the tag.
65-
5. Copy & paste the changelog entry for this release into the description.
66-
6. If this is a pre-release version, check the pre-release box.
67-
7. Hit "Publish release".
68-
69-
10. If this was a fix release, merge changes to the master branch:
70-
```bash
71-
git checkout master
72-
git reset --hard origin/master
73-
git merge --no-ff v0.1-fixes
74-
# Resolve conflicts. Accept master's versions of gradle.properties and podspecs.
75-
git push origin master
76-
```
63+
1. Create the release on GitHub:
64+
1. Go to the [Releases](https://github.com/square/workflow/releases) page for the GitHub
65+
project.
66+
1. Click "Draft a new release".
67+
1. Enter the tag name you just pushed.
68+
1. Title the release with the same name as the tag.
69+
1. Copy & paste the changelog entry for this release into the description.
70+
1. If this is a pre-release version, check the pre-release box.
71+
1. Hit "Publish release".
72+
73+
1. If this was a fix release, merge changes to the master branch:
74+
```bash
75+
git checkout master
76+
git reset --hard origin/master
77+
git merge --no-ff v0.1-fixes
78+
# Resolve conflicts. Accept master's versions of gradle.properties and podspecs.
79+
git push origin master
80+
```
7781

78-
11. Publish the website:
79-
```bash
80-
# If you haven't already installed mkdocs, run:
81-
# pip install mkdocs mkdocs-material
82-
./deploy_website.sh
83-
```
82+
1. Publish the website:
83+
```bash
84+
# If you haven't already installed mkdocs, run:
85+
# pip install mkdocs mkdocs-material
86+
./deploy_website.sh
87+
```
8488

8589
---
8690

@@ -98,8 +102,8 @@ To build and install the current version to your local Maven repository (`~/.m2`
98102

99103
#### Configuration
100104

101-
In order to deploy artifacts to a Maven repository, you'll need to set 4 properties in your
102-
private Gradle properties file (`~/.gradle/gradle.properties`):
105+
In order to deploy artifacts to a Maven repository, you'll need to set 4 properties in your private
106+
Gradle properties file (`~/.gradle/gradle.properties`):
103107

104108
```
105109
RELEASE_REPOSITORY_URL=<url of release repository>

0 commit comments

Comments
 (0)