Skip to content

Commit fb6718a

Browse files
authored
Use Prettier to lint/format instead of Rubocop (#178)
I use CoC in Vim to integrate with language servers similar to VSCode, but I've never gotten Solargraph, which incorporates Rubocop, to work. On the other hand, Prettier has been a pleasant experience to use, and I love how I've never had to write a single configuration file. To fix this, this commit: * replaces Rubocop with Prettier; * reformats all files to match Prettier's format; * adds a new step to the GitHub workflow to ensure that all files pass the lint step; and * adds an optional Git hook so that before you push, all files will linted Note that in order to get started with this project, you'll need to have Node installed. I recommend using `asdf` which can manage not only Node but also Ruby as well. Then you'll want to run `yarn install`. I've included this in the Contributing doc as well as in the setup script.
1 parent da2bcac commit fb6718a

File tree

216 files changed

+19206
-16852
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+19206
-16852
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.yarn/** linguist-vendored
2+
/.yarn/releases/* binary
3+
/.yarn/plugins/**/* binary
4+
/.pnp.* binary linguist-generated

.github/workflows/super_diff.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,36 @@ on:
44
branches:
55
- main
66
- ci-*
7-
paths-ignore:
8-
- '**.md'
97
pull_request:
108
types:
119
- opened
1210
- synchronize
13-
paths-ignore:
14-
- '**.md'
11+
concurrency:
12+
group: build-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
1514
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
bundler-cache: true
23+
- name: Use Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version-file: ".nvmrc"
27+
cache: "yarn"
28+
- name: Install Ruby dependencies
29+
run: bin/ci/install
30+
- name: Install Yarn dependencies
31+
run: yarn --immutable
32+
- name: Lint
33+
run: yarn lint
1634
test:
35+
needs:
36+
- lint
1737
runs-on: ubuntu-20.04
1838
strategy:
1939
fail-fast: false
@@ -42,22 +62,23 @@ jobs:
4262
steps:
4363
- uses: actions/checkout@v3
4464
- name: Set up Ruby
45-
id: set-up-ruby
4665
uses: ruby/setup-ruby@v1
4766
with:
4867
ruby-version: ${{ matrix.ruby }}
4968
bundler-cache: true
5069
- name: Run tests
5170
run: bin/ci/run-tests
5271
test_ruby_3:
72+
needs:
73+
- lint
5374
runs-on: ubuntu-20.04
5475
strategy:
5576
fail-fast: false
5677
matrix:
5778
ruby:
58-
- '3.0'
59-
- '3.1'
60-
- '3.2'
79+
- "3.0"
80+
- "3.1"
81+
- "3.2"
6182
rails_appraisal:
6283
- rails_6_0
6384
- rails_6_1
@@ -82,7 +103,6 @@ jobs:
82103
steps:
83104
- uses: actions/checkout@v3
84105
- name: Set up Ruby
85-
id: set-up-ruby
86106
uses: ruby/setup-ruby@v1
87107
with:
88108
ruby-version: ${{ matrix.ruby }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
.DS_Store
22
Gemfile.lock
3+
gemfiles/.bundle
34
gemfiles/*.gemfile.lock
5+
node_modules
46
pkg
57
spec/examples.txt
68
tmp
79
zeus.server.log
810
zeus.server-start.log
11+
12+
# Ignore Yarn stuff
13+
.pnp.*
14+
.yarn/*
15+
!.yarn/patches
16+
!.yarn/plugins
17+
!.yarn/releases
18+
!.yarn/sdks
19+
!.yarn/versions

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.14.0

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.yarn/cache
2+
.yarn/releases
3+
gemfiles
4+
vendor/bundle

.rubocop.yml

Lines changed: 0 additions & 174 deletions
This file was deleted.

.tool-versions

Lines changed: 0 additions & 1 deletion
This file was deleted.

.yarn/releases/yarn-3.4.1.cjs

Lines changed: 873 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.4.1.cjs

ARCHITECTURE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ but here are some quick hits:
55

66
## Basic concepts
77

8-
* An **object inspector** generates a multi-line textual representation of an object,
8+
- An **object inspector** generates a multi-line textual representation of an object,
99
similar to PrettyPrinter in Ruby or AwesomePrint,
1010
but more appropriate for showing within a diff.
11-
* An **operation** represents a difference in one value from another
11+
- An **operation** represents a difference in one value from another
1212
in the context of a data structure.
13-
That difference can either be an *delete*, *insert*, or *change*.
14-
* An **operation tree** is the set of all operations between two data structures,
13+
That difference can either be an _delete_, _insert_, or _change_.
14+
- An **operation tree** is the set of all operations between two data structures,
1515
where each operation represents the difference between an inner element within the structure
1616
(value for an array or a key/value pair for a hash).
1717
Since change operations represent elements that have child elements,
1818
they also have child operations to represent those child elements.
1919
Those child operations can themselves have children, etc.
2020
This descendancy is what forms the tree.
21-
* An **operation tree builder** makes a comparison between two like data structures
21+
- An **operation tree builder** makes a comparison between two like data structures
2222
and generates an operation tree to represent the differences.
23-
* A **diff formatter** takes an operation tree
23+
- A **diff formatter** takes an operation tree
2424
and spits out a textual representation of that tree in the form of a conventional diff.
2525
Each operation may in fact generate more than one line in the final diff
2626
because the object that is specific to the operation is run through an object inspector.
27-
* Finally, a **differ** ties everything together
27+
- Finally, a **differ** ties everything together
2828
and figures out which operation tree builder and diff formatter to use for a particular pair of values
2929
(where one value is the "expected" and the other is the "actual").
3030

0 commit comments

Comments
 (0)