Skip to content

Commit

Permalink
Configure EditorConfig and apply EditorConfig to all files (vercel#1025)
Browse files Browse the repository at this point in the history
This mostly applies a lot of line-ending fixes. A few other indentation issues were detected. All "material" changes can be seen in `git show --ignore-space-at-eol`.
  • Loading branch information
nathanhammond authored Apr 8, 2022
1 parent 5668161 commit f516b23
Show file tree
Hide file tree
Showing 50 changed files with 165 additions and 146 deletions.
30 changes: 25 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
charset = utf-8
end_of_line = lf
indent_size = 2

[*.{js,ts}]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
indent_size = 2

[{go.mod,go.sum,*.go}]
indent_style = tab

[*.{md,mdx}]
insert_final_newline = true

[*.html]
insert_final_newline = false

[nginx.conf]
indent_size = 8

[*.svg]
insert_final_newline = false

[LICENSE]
insert_final_newline = false
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ dist
*.svg
*.lock
*.npmignore
examples/**
examples/**
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Apply EditorConfig to all files
e9a9249db781d6498a7c2ad057149ac1cb432302
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ store
todos.md
examples/*/*.lock
examples/*/*-lock.yaml
.store
.store
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ LICENSE
.dockerignore
*.patch
*.toml
*.prisma
*.prisma
8 changes: 4 additions & 4 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fmt-go:
install: | ./package.json
pnpm i --filter=cli...

e2e: install
e2e: install
pnpm e2e

cmd/turbo/version.go: version.txt
Expand Down Expand Up @@ -148,10 +148,10 @@ platform-neutral: | turbo
cd npm/turbo-install && npm version "$(TURBO_VERSION)" --allow-same-version
node ./scripts/bump-version.js

platform-create-turbo:
platform-create-turbo:
cd ../packages/create-turbo && npm version "$(TURBO_VERSION)" --allow-same-version && npm run build

platform-turbo-codemod:
platform-turbo-codemod:
cd ../packages/turbo-codemod && npm version "$(TURBO_VERSION)" --allow-same-version && npm run build

test-prepublish:
Expand Down Expand Up @@ -263,7 +263,7 @@ bench/nx: demo/nx
cd demo/nx && node_modules/.bin/nx run-many --target=build --all

bench/turbo: demo/turbo turbo
cd demo/turbo && ../../turbo run test
cd demo/turbo && ../../turbo run test

bench/turbo-new: demo/turbo
cd demo/turbo && ../../turbo-new run build test
Expand Down
22 changes: 11 additions & 11 deletions cli/internal/fs/copy_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ func WalkMode(rootPath string, callback func(name string, isDir bool, mode os.Fi
return godirwalk.Walk(rootPath, &godirwalk.Options{
Callback: func(name string, info *godirwalk.Dirent) error {
// currently we support symlinked files, but not symlinked directories:
// For copying, we Mkdir and bail if we encounter a symlink to a directoy
// For finding packages, we enumerate the symlink, but don't follow inside
isDir, err := info.IsDirOrSymlinkToDir()
if err != nil {
pathErr := &os.PathError{}
if errors.As(err, &pathErr) {
// If we have a broken link, skip this entry
return godirwalk.SkipThis
}
return err
}
// For copying, we Mkdir and bail if we encounter a symlink to a directoy
// For finding packages, we enumerate the symlink, but don't follow inside
isDir, err := info.IsDirOrSymlinkToDir()
if err != nil {
pathErr := &os.PathError{}
if errors.As(err, &pathErr) {
// If we have a broken link, skip this entry
return godirwalk.SkipThis
}
return err
}
return callback(name, isDir, info.ModeType())
},
ErrorCallback: func(pathname string, err error) godirwalk.ErrorAction {
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/prune/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Options:
--help Show this screen.
--scope Specify package to act as entry point
for pruned monorepo (required).
--docker Output pruned workspace into 'full'
and 'json' directories optimized for
--docker Output pruned workspace into 'full'
and 'json' directories optimized for
Docker layer caching. (default false)
`
return strings.TrimSpace(helpText)
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ Options:
mergebase. This uses the git diff ${target_branch}...
mechanism to identify which packages have changed.
--team The slug or team ID of the remote cache team.
--token A bearer token for remote caching. You can also set
the value of the current token by setting an
--token A bearer token for remote caching. You can also set
the value of the current token by setting an
environment variable named TURBO_TOKEN.
--ignore Files to ignore when calculating changed files
(i.e. --since). Supports globs.
Expand Down
8 changes: 4 additions & 4 deletions cli/internal/scope/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ func (r *Resolver) filterSubtreesWithSelector(selector *TargetSelector) (util.Se
}
for changedPkg := range changedPkgs {
if !selector.excludeSelf && pkg == changedPkg {
roots.Add(pkg)
break
}
if deps.Include(changedPkg) {
roots.Add(pkg)
break
}
if deps.Include(changedPkg) {
roots.Add(pkg)
matched.Add(changedPkg)
break
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/scope/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func (o *Opts) asFilterPatterns() []string {
if len(o.Patterns) > 0 {
// --scope implies our tweaked syntax to see if any dependency matches
if since != "" {
since = "..." + since
}
since = "..." + since
}
for _, pattern := range o.Patterns {
if strings.HasPrefix(pattern, "!") {
patterns = append(patterns, pattern)
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/ui/colors.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func GetColorModeFromEnv() ColorMode {
// We don't currently use the level for anything specific, and just treat things as on and off.
//
// Note: while "false" and "true" aren't documented, the library coerces these values to 0 and 1
// respectively, so that behavior is reproduced here as well.
// respectively, so that behavior is reproduced here as well.
// https://www.npmjs.com/package/supports-color

switch forceColor := os.Getenv("FORCE_COLOR"); {
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (into *stripAnsiWriter) Write(p []byte) (int, error) {
// not failing under typical operation as well.
return n, err
}

// Write must return a non-nil error if it returns n < len(p). Consequently, if the
// wrappedWrite.Write call succeeded we will return len(p) as the number of bytes
// written.
Expand All @@ -80,7 +80,7 @@ func Default() *cli.ColoredUi {

func BuildColoredUi(colorMode ColorMode) *cli.ColoredUi {
colorMode = applyColorMode(colorMode);

var outWriter, errWriter io.Writer

if colorMode == ColorModeSuppressed {
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/turbo-android-arm64/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------

This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
defined by the Mozilla Public License, v. 2.0.
4 changes: 2 additions & 2 deletions cli/npm/turbo-install/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p align="center">
<img width="340" alt="Turborepo logo" src="https://user-images.githubusercontent.com/4060187/106504110-82f58d00-6494-11eb-87b7-a16d4f68bc5a.png">
<img width="340" alt="Turborepo logo" src="https://user-images.githubusercontent.com/4060187/106504110-82f58d00-6494-11eb-87b7-a16d4f68bc5a.png">
</p>

<p align="center">
<p align="center">
<a aria-label="NPM version" href="https://www.npmjs.com/package/turbo">
<img alt="" src="https://badgen.net/npm/v/turbo">
</a>
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/turbo-install/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"turbo-windows-32": "1.2.2-canary.0",
"turbo-windows-64": "1.2.2-canary.0"
}
}
}
10 changes: 5 additions & 5 deletions cli/scripts/monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export class Monorepo {
[user]
name = GitHub Actions
email = [email protected]
[init]
defaultBranch = main
defaultBranch = main
`
);
execa.sync("git", ["init", "-q"], { cwd: this.root });
Expand Down Expand Up @@ -93,7 +93,7 @@ export class Monorepo {
"pnpm-workspace.yaml": `packages:
- packages/*`,
"pnpm-lock.yaml": `lockfileVersion: 5.3
importers:
.:
Expand All @@ -110,7 +110,7 @@ importers:
packages/c:
specifiers: {}
`,
});
execa.sync("pnpm", ["install", "--recursive"], {
Expand Down Expand Up @@ -199,7 +199,7 @@ const path = require('path');
console.log('building ${name}');
if (!fs.existsSync(path.join(__dirname, 'dist'))){
fs.mkdirSync(path.join(__dirname, 'dist'));
fs.mkdirSync(path.join(__dirname, 'dist'));
}
fs.copyFileSync(
Expand Down
2 changes: 1 addition & 1 deletion cli/scripts/nginx/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cacher_root
cacher_root
2 changes: 1 addition & 1 deletion cli/scripts/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ http {
client_max_body_size 512M;
}
}
}
}
6 changes: 3 additions & 3 deletions docs/components/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class Window extends React.PureComponent {
height: 100%;
background: #050b13;
position: relative;
border-radius: 8px;
border-radius: 8px;
}
.window.white {
border: 0;
Expand Down Expand Up @@ -104,9 +104,9 @@ export class Window extends React.PureComponent {
display: inline-block;
white-space: nowrap;
min-width: 28px;
border-radius: 8px;
border-radius: 8px;
}
.terminal-special:after {
content: '';
display: block;
Expand Down
2 changes: 1 addition & 1 deletion docs/components/safelist.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dark:prose-dark
dark:prose-dark
2 changes: 1 addition & 1 deletion docs/pages/blog/saml-sso-now-available.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: SAML SSO is now available
date: 2021/08/03
description: SAML Single Sign-on (SSO) is now available to Enterprise customers thanks to our friends over at WorkOS.
description: SAML Single Sign-on (SSO) is now available to Enterprise customers thanks to our friends over at WorkOS.
tag: web development
ogImage: /images/blog/og-saml.png
---
Expand Down
12 changes: 6 additions & 6 deletions docs/pages/blog/turbo-0-4-0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Here's how it works:
"turbo": {
"pipeline": {
"build": {
// This `^` tells turbo that this pipeline target relies on a topological target being completed.
// This `^` tells turbo that this pipeline target relies on a topological target being completed.
// In english, this reads as: "this package's `build` command depends on its dependencies' or
// devDependencies' `build` command being completed"
"dependsOn": ["^build"]
Expand All @@ -145,8 +145,8 @@ Here's how it works:
// In English, this reads as: "this package's `test` command depends on its `lint` and `build` command first being completed"
"dependsOn": ["lint", "build"]
},
"lint": {},
"dev": {},
"lint": {},
"dev": {},

}
}
Expand Down Expand Up @@ -180,11 +180,11 @@ Building on the example from above, you can now set cache output conventions acr
"outputs": ["coverage/**"],
"dependsOn": ["lint", "build"]
},
"dev": {
"dev": {
// Never cache the `dev` command
"cache": false
},
"lint": {},
},
"lint": {},
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ As it turns out, you might not even need references or even an interim TypeScrip
"main": "./src/index.ts"
"types": "./src/index.ts", // yes, this works!
"dependencies": {
...
...
},
"devDependencies": {
...
...
}
}
```
Expand Down
3 changes: 1 addition & 2 deletions docs/pages/docs/features/filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,5 @@ turbo run build --filter=./apps/* --filter=!admin
```

<Callout type="idea" icon={<HeartIcon className="mt-1 h-5 w-5 text-gray-400" aria-hidden="true" />}>
Turborepo's Filter API design and docs were/are inspired by
[pnpm](https://pnpm.io/filtering)
Turborepo's Filter API design and docs were/are inspired by [pnpm](https://pnpm.io/filtering)
</Callout>
4 changes: 1 addition & 3 deletions docs/pages/docs/guides/continuous-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ To use Vercel Remote Caching, you can get the value of these variables in a few
1. Create a Scoped Access Token to your account in the [Vercel Dashboard](https://vercel.com/account/tokens)

![Vercel Access Tokens](/images/docs/vercel-tokens.png)

![Vercel Access Tokens](/images/docs/vercel-create-token.png)

Copy the value to a safe place. You'll need it in a moment.

2. Go to your GitHub repository settings and click on the **Secrets** and then **Actions** tab.
Create a new secret called `TURBO_TOKEN` and enter the value of your Scoped Access Token.
2. Go to your GitHub repository settings and click on the **Secrets** and then **Actions** tab. Create a new secret called `TURBO_TOKEN` and enter the value of your Scoped Access Token.

![GitHub Secrets](/images/docs/github-actions-secrets.png)
![GitHub Secrets Create](/images/docs/github-actions-create-secret.png)
Expand Down
2 changes: 1 addition & 1 deletion docs/public/images/logos/lattice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/public/images/logos/makeswift.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/public/images/logos/ondeck.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f516b23

Please sign in to comment.