Skip to content

Commit

Permalink
Run prettier on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin committed Dec 2, 2020
1 parent 43fea26 commit 2a9ab1f
Show file tree
Hide file tree
Showing 65 changed files with 2,826 additions and 2,108 deletions.
6 changes: 3 additions & 3 deletions .attic/gulp/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// set the base folder of this project
global.basefolder = `${__dirname}`
require ("rechoir").prepare(require('interpret').extensions, './.gulp/gulpfile.iced');
require ('./.gulp/gulpfile.iced')
global.basefolder = `${__dirname}`;
require("rechoir").prepare(require("interpret").extensions, "./.gulp/gulpfile.iced");
require("./.gulp/gulpfile.iced");
38 changes: 19 additions & 19 deletions .default-eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
parser: '@typescript-eslint/parser'
parser: "@typescript-eslint/parser"
plugins:
- '@typescript-eslint'
- "@typescript-eslint"
- prettier
env:
es6: true
Expand All @@ -17,28 +17,28 @@ parserOptions:
sourceType: module
warnOnUnsupportedTypeScriptVersion: false
rules:
'@typescript-eslint/no-this-alias': 'off'
'@typescript-eslint/interface-name-prefix': 'off'
'@typescript-eslint/explicit-function-return-type': 'off'
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-empty-interface': 'off'
'@typescript-eslint/no-namespace': 'off'
'@typescript-eslint/explicit-member-accessibility': 'off'
'@typescript-eslint/no-unused-vars': 'off'
'@typescript-eslint/no-parameter-properties': 'off'
'@typescript-eslint/no-angle-bracket-type-assertion': 'off'
'require-atomic-updates': 'off'
'@typescript-eslint/consistent-type-assertions':
"@typescript-eslint/no-this-alias": "off"
"@typescript-eslint/interface-name-prefix": "off"
"@typescript-eslint/explicit-function-return-type": "off"
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-empty-interface": "off"
"@typescript-eslint/no-namespace": "off"
"@typescript-eslint/explicit-member-accessibility": "off"
"@typescript-eslint/no-unused-vars": "off"
"@typescript-eslint/no-parameter-properties": "off"
"@typescript-eslint/no-angle-bracket-type-assertion": "off"
"require-atomic-updates": "off"
"@typescript-eslint/consistent-type-assertions":
- warn
- assertionStyle: 'angle-bracket'
- assertionStyle: "angle-bracket"

'@typescript-eslint/array-type':
"@typescript-eslint/array-type":
- warn
- default: generic
no-undef: 'off'
no-unused-vars: 'off'
no-undef: "off"
no-unused-vars: "off"
linebreak-style:
- 'warn'
- "warn"
- unix
semi:
- warn
Expand Down
77 changes: 38 additions & 39 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,48 @@ on:
push:
pull_request:
schedule:
- cron: '0 19 * * 0'
- cron: "0 19 * * 0"

jobs:
CodeQL-Build:

# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
6 changes: 3 additions & 3 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
trailingComma: 'all'
trailingComma: "all"
printWidth: 120
quoteProps: 'consistent'
endOfLine: 'auto'
quoteProps: "consistent"
endOfLine: "auto"
arrowParens: always
43 changes: 23 additions & 20 deletions .scripts/for-each.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { spawn } = require('child_process');
const { readFileSync } = require('fs');
const { resolve } = require('path');
const { spawn } = require("child_process");
const { readFileSync } = require("fs");
const { resolve } = require("path");

function read(filename) {
const txt = readFileSync(filename, "utf8")
Expand All @@ -17,8 +17,6 @@ const repo = `${__dirname}/..`;
const rush = read(`${repo}/rush.json`);
const pjs = {};



function forEachProject(onEach) {
// load all the projects
for (const each of rush.projects) {
Expand All @@ -42,28 +40,33 @@ function npmForEach(cmd) {
const proc = spawn("npm", ["--silent", "run", cmd], { cwd: location, shell: true, stdio: "inherit" });
procs.push(proc);
result[name] = {
name, location, project, proc,
name,
location,
project,
proc,
};
}
});

procs.forEach(proc => proc.on("close", (code, signal) => {
count--;
exitCode += code;
procs.forEach((proc) =>
proc.on("close", (code, signal) => {
count--;
exitCode += code;

if (count === 0) {
const t2 = process.uptime() * 100;
if (count === 0) {
const t2 = process.uptime() * 100;

console.log('---------------------------------------------------------');
if (exitCode !== 0) {
console.log(` Done : command '${cmd}' - ${Math.floor(t2 - t1) / 100} s -- Errors ${exitCode} `)
} else {
console.log(` Done : command '${cmd}' - ${Math.floor(t2 - t1) / 100} s -- No Errors `)
console.log("---------------------------------------------------------");
if (exitCode !== 0) {
console.log(` Done : command '${cmd}' - ${Math.floor(t2 - t1) / 100} s -- Errors ${exitCode} `);
} else {
console.log(` Done : command '${cmd}' - ${Math.floor(t2 - t1) / 100} s -- No Errors `);
}
console.log("---------------------------------------------------------");
process.exit(exitCode);
}
console.log('---------------------------------------------------------');
process.exit(exitCode);
}
}));
}),
);

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion .scripts/npm-run.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Runs the npm run command on each project that has it.
require('./for-each').npm(process.argv[2]);
require("./for-each").npm(process.argv[2]);
105 changes: 52 additions & 53 deletions .scripts/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,59 @@
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
- master
- master

pool:
vmImage: 'ubuntu-latest'
vmImage: "ubuntu-latest"

steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'

- script: |
# ensure latest npm is installed
npm install -g npm
npm install -g publish-release
# Remove any existing node_modules folder just in case
rm -rf node_modules
# make sure the versions are all synchronized
npx @microsoft/rush set-versions
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# copy the autorest folder into autorestautorest
# and tweak the files so we can build @autorest/autorest too.
cp -r autorest autorestautorest
sed 's/\"name\": \"autorest\",/\"name\": \"@autorest\/autorest\",/g' -i autorestautorest/package.json
sed 's/\"autorest\":/\"autorest-beta\":/g' -i autorestautorest/package.json
sed 's/.*#region.*//g' -i rush.json
# pull in dependencies
npx @microsoft/rush update
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# compile the code
npx @microsoft/rush rebuild
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# build the packages
npx @microsoft/rush publish --publish --pack --include-all
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# publish packages to a github release.
# publish autorest cli and beta (@autorest/autorest)
cd autorest
v=`node -e "console.log(require('./package.json').version)"`
publish-release --token $(azuresdk-github-pat) --repo autorest --owner azure --name autorest-$v --tag autorest-$v --notes='prerelease build' --prerelease --editRelease false --assets ../common/temp/artifacts/packages/autorest-$v.tgz --assets ../common/temp/artifacts/packages/autorest-autorest-$v.tgz --target_commitish $(Build.SourceBranchName)
cd ..
# publish autorest core
cd core
v=`node -e "console.log(require('./package.json').version)"`
publish-release --token $(azuresdk-github-pat) --repo autorest --owner azure --name autorest-core-$v --tag autorest-core-$v --notes='prerelease build' --prerelease --editRelease false --assets ../common/temp/artifacts/packages/autorest-core-$v.tgz --target_commitish $(Build.SourceBranchName)
cd ..
- task: NodeTool@0
inputs:
versionSpec: "10.x"
displayName: "Install Node.js"

- script: |
# ensure latest npm is installed
npm install -g npm
npm install -g publish-release
# Remove any existing node_modules folder just in case
rm -rf node_modules
# make sure the versions are all synchronized
npx @microsoft/rush set-versions
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# copy the autorest folder into autorestautorest
# and tweak the files so we can build @autorest/autorest too.
cp -r autorest autorestautorest
sed 's/\"name\": \"autorest\",/\"name\": \"@autorest\/autorest\",/g' -i autorestautorest/package.json
sed 's/\"autorest\":/\"autorest-beta\":/g' -i autorestautorest/package.json
sed 's/.*#region.*//g' -i rush.json
# pull in dependencies
npx @microsoft/rush update
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# compile the code
npx @microsoft/rush rebuild
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# build the packages
npx @microsoft/rush publish --publish --pack --include-all
rc=$?; if [ $rc -ne 0 ]; then exit $rc ; fi
# publish packages to a github release.
# publish autorest cli and beta (@autorest/autorest)
cd autorest
v=`node -e "console.log(require('./package.json').version)"`
publish-release --token $(azuresdk-github-pat) --repo autorest --owner azure --name autorest-$v --tag autorest-$v --notes='prerelease build' --prerelease --editRelease false --assets ../common/temp/artifacts/packages/autorest-$v.tgz --assets ../common/temp/artifacts/packages/autorest-autorest-$v.tgz --target_commitish $(Build.SourceBranchName)
cd ..
# publish autorest core
cd core
v=`node -e "console.log(require('./package.json').version)"`
publish-release --token $(azuresdk-github-pat) --repo autorest --owner azure --name autorest-core-$v --tag autorest-core-$v --notes='prerelease build' --prerelease --editRelease false --assets ../common/temp/artifacts/packages/autorest-core-$v.tgz --target_commitish $(Build.SourceBranchName)
cd ..
Loading

0 comments on commit 2a9ab1f

Please sign in to comment.