Skip to content

Commit

Permalink
Remove builtin flowconfig suppress_comments (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmay committed Jul 21, 2020
1 parent 7fa8706 commit 900cb7e
Show file tree
Hide file tree
Showing 18 changed files with 274 additions and 391 deletions.
4 changes: 3 additions & 1 deletion ci/memo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ cd "$(dirname "$0")/.."
set -e

./do.sh update
./do.sh fmt memo --all -- --check
./do.sh build-native memo -D warnings
./do.sh build memo
./do.sh clippy memo
./do.sh clippy memo -- --deny=warnings
./do.sh doc memo
./do.sh test memo
6 changes: 5 additions & 1 deletion ci/token-swap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ cd "$(dirname "$0")/.."

./do.sh update
./do.sh build token
./do.sh fmt token-swap --all -- --check
./do.sh build-native token-swap -D warnings
./do.sh build token-swap
./do.sh clippy token-swap
./do.sh clippy token-swap -- --deny=warnings
./do.sh doc token-swap
./do.sh test token-swap
cc token-swap/inc/token-swap.h -o token-swap/target/token-swap.gch
Expand All @@ -19,6 +21,8 @@ npm install
cd "../../token-swap/js"

npm install
npm run lint
npm run flow
npm run cluster:localnet
npm run localnet:update
npm run localnet:up
Expand Down
8 changes: 6 additions & 2 deletions ci/token.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#!/usr/bin/env bash

set -e
set -ex

cd "$(dirname "$0")/.."

./do.sh update
./do.sh fmt token --all -- --check
./do.sh build-native token -D warnings
./do.sh build token
./do.sh clippy token
./do.sh clippy token -- --deny=warnings
./do.sh doc token
./do.sh test token
cc token/inc/token.h -o token/target/token.gch

cd "$(dirname "$0")/../token/js"

npm install
npm run lint
npm run flow
npm run cluster:localnet
npm run localnet:update
npm run localnet:up
Expand Down
35 changes: 26 additions & 9 deletions do.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd "$(dirname "$0")"
usage() {
cat <<EOF
Usage: do.sh <action> <project>
Usage: do.sh <action> <project> <action specific arguments>
Supported actions:
build
Expand All @@ -17,6 +17,10 @@ Supported actions:
test
update
Supported projects:
all
any directory containing a Cargo.toml file
EOF
}

Expand All @@ -38,41 +42,49 @@ perform_action() {
"$sdkDir"/dependencies/llvm-native/bin/llvm-objcopy --strip-all "$so_path/${so_name}.so" "$so_path/$so_name.so"
fi
;;
build-native)
(
cd "$2"
echo "build $2"
export RUSTFLAGS="${@:4}"
cargo build
)
;;
clean)
"$sdkDir"/rust/clean.sh "$2"
;;
test)
(
cd "$2"
echo "test $2"
cargo +nightly test
cargo +nightly test ${@:4}
)
;;
clippy)
(
cd "$2"
echo "clippy $2"
cargo +nightly clippy
cargo +nightly clippy ${@:4}
)
;;
fmt)
(
cd "$2"
echo "formatting $2"
cargo fmt
cargo fmt ${@:4}
)
;;
doc)
(
cd "$2"
echo "generating docs $2"
cargo doc
cargo doc ${@:4}
)
;;
update)
mkdir -p $sdkParentDir
./bpf-sdk-install.sh $sdkParentDir
./do.sh clean
./do.sh clean all
;;
dump)
# Dump depends on tools that are not installed by default and must be installed manually
Expand Down Expand Up @@ -129,22 +141,27 @@ perform_action() {
set -e
if [[ $1 == "update" ]]; then
perform_action "$1"
exit
else
if [[ "$#" -lt 2 ]]; then
usage
exit
fi
if [[ ! -d "$sdkDir" ]]; then
./do.sh update
fi
fi

if [[ "$#" -ne 2 ]]; then
if [[ $2 == "all" ]]; then
# Perform operation on all projects
for project in */; do
if [[ -f "$project"Cargo.toml ]]; then
perform_action "$1" "$PWD/$project" "$project"
perform_action "$1" "$PWD/$project" "$project" ${@:3}
else
continue
fi
done
else
# Perform operation on requested project
perform_action "$1" "$PWD/$2" "$2"
perform_action "$1" "$PWD/$2" "$2" "${@:3}"
fi
2 changes: 1 addition & 1 deletion token-swap/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion token-swap/js/.eslintignore

This file was deleted.

6 changes: 6 additions & 0 deletions token-swap/js/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line
module.exports = {
// eslint-disable-line import/no-commonjs
env: {
Expand Down Expand Up @@ -49,4 +50,9 @@ module.exports = {
'require-await': ['error'],
semi: ['error', 'always'],
},
settings: {
react: {
version: 'detect',
},
},
};
2 changes: 0 additions & 2 deletions token-swap/js/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ module.system.node.resolve_dirname=./src
module.use_strict=true
experimental.const_params=true
include_warnings=true
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
20 changes: 10 additions & 10 deletions token-swap/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"author": "",
"license": "MIT",
"devDependencies": {
"prettier": "^2.0.2"
"prettier": "^2.0.5"
},
"dependencies": {
"@solana/web3.js": "^0.62.0",
Expand All @@ -47,33 +47,33 @@
"bn.js": "^5.0.0",
"body-parser": "^1.18.3",
"buffer-layout": "^1.2.0",
"css-loader": "^3.1.0",
"css-loader": "^3.6.0",
"dotenv": "8.2.0",
"eslint": "^7.4.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-react": "^7.20.3",
"event-emitter": "^0.3.5",
"express": "^4.16.4",
"flow-bin": "0.129.0",
"flow-typed": "^3.0.0",
"flow-typed": "^3.2.0",
"http-server": "^0.12.3",
"jayson": "^3.0.1",
"jayson": "^3.3.3",
"json-to-pretty-yaml": "^1.2.2",
"mkdirp-promise": "^5.0.1",
"moment": "^2.22.2",
"moment": "^2.27.0",
"mz": "^2.7.0",
"node-fetch": "^2.2.0",
"react": "^16.5.2",
"react-bootstrap": "^1.0.0",
"react-bootstrap": "^1.1.1",
"react-dom": "^16.5.2",
"readline-promise": "^1.0.3",
"semver": "^7.0.0",
"superstruct": "^0.10.12",
"watch": "^1.0.2",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.1",
"webpack-dev-server": "^3.1.9"
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"engines": {
"node": "11.x"
Expand Down
4 changes: 1 addition & 3 deletions token-swap/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
use num_derive::FromPrimitive;
use num_traits::FromPrimitive;
#[cfg(target_arch = "bpf")]
use solana_sdk::program::invoke_signed;
use solana_sdk::{
decode_error::DecodeError,
info,
program_error::{PrintProgramError, ProgramError},
decode_error::DecodeError,
};
use thiserror::Error;

Expand Down
2 changes: 0 additions & 2 deletions token-swap/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

//! Instruction types
#[cfg(target_arch = "bpf")]
use solana_sdk::program::invoke_signed;
use solana_sdk::{
instruction::{AccountMeta, Instruction},
program_error::ProgramError,
Expand Down
6 changes: 4 additions & 2 deletions token-swap/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ use crate::{
error::Error,
instruction::{unpack, Fee, SwapInstruction},
};
#[cfg(not(target_arch = "bpf"))]
use solana_sdk::instruction::Instruction;
#[cfg(target_arch = "bpf")]
use solana_sdk::program::invoke_signed;
use solana_sdk::{
account_info::AccountInfo, entrypoint::ProgramResult, info, instruction::Instruction,
program_error::ProgramError, account_info::next_account_info, pubkey::Pubkey,
account_info::next_account_info, account_info::AccountInfo, entrypoint::ProgramResult, info,
program_error::ProgramError, pubkey::Pubkey,
};
use std::mem::size_of;

Expand Down
1 change: 0 additions & 1 deletion token/js/.eslintignore

This file was deleted.

6 changes: 6 additions & 0 deletions token/js/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line
module.exports = {
// eslint-disable-line import/no-commonjs
env: {
Expand Down Expand Up @@ -49,4 +50,9 @@ module.exports = {
'require-await': ['error'],
semi: ['error', 'always'],
},
settings: {
react: {
version: 'detect',
},
},
};
2 changes: 0 additions & 2 deletions token/js/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ module.system.node.resolve_dirname=./src
module.use_strict=true
experimental.const_params=true
include_warnings=true
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
Loading

0 comments on commit 900cb7e

Please sign in to comment.