Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor standards and cleanup additions. #581

Merged
merged 9 commits into from
Dec 1, 2017

Conversation

shrugs
Copy link
Contributor

@shrugs shrugs commented Nov 24, 2017

  • more comprehensive gitignore
  • use env variables instead of magic string to choose mnemonic and infura access
  • update yarn lock ( Redundant lockfiles (npm and yarn) #284 )
  • an eslint configuration based on standard (with a global --fix applied)
  • renaming all test files to add .test.js as a suffix to match traditional testing standards
  • moving all of the mocked solidity files into a mocks/ directory.
  • manually fixing linting errors in tests where appropriate

Discussion

I'm very partial to the space-before-function-paren (always) and semi rules (never), but I understand if people think differently. Regardless of which direction we pick, we should enforce it, so the questions are:

  1. should we enforce spaces before function parens? i.e. function () {} vs function() {} and (in classes) functionName () {} vs functionName() {}. I think the former looks prettier, but ¯\_(ツ)_/¯
  2. should we enforce semicolons or not? I'm partial to "no semicolons unless logically required".

I'm aware that this is a massive PR and would mostly likely require rebasing any outstanding PRs to avoid merge conflicts. If anyone has strong opinions on that, please voice them.

@shrugs shrugs force-pushed the feat/minor-additions branch from b59be03 to 99bd138 Compare November 27, 2017 16:21
@shrugs shrugs changed the title Feat/minor additions Minor standards and cleanup additions. Nov 27, 2017
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we enforce spaces before function parens?

I'd go with always. 👍

should we enforce semicolons or not? I'm partial to "no semicolons unless logically required".

Although I agree it looks prettier, I feel more comfortable if we consistently use semicolons. I'm open to discussion but I think it's definitely the most robust thing to do, and we should aim for robustness. Additionally, most of the repo is already using semicolons, and most of this PR consists of removing them, so it would help make it somewhat less "massive". 😃

Other than that, this is a welcome addition! Great work.

"mocha-lcov-reporter": "^1.3.0",
"solidity-coverage": "^0.2.2",
"truffle": "^4.0.0",
"truffle-hdwallet-provider": "0.0.3"
},
"dependencies": {
"dotenv": "^4.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed in dependencies or could it go in devDependencies? It only seems necessary if you want to run the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's required at runtime for truffle.js, so theoretically it belongs in dependencies. But we really only use truffle for tests, since anyone using this project is including it as a dependency and using their own truffle.

It's up to you. We can also remove it, but being able to include a .env file for things like MNEMONIC and infura api keys is a lot easier than making sure to export them in your environment or include them in the command line when you run truffle

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it this way. dotenv has no production dependencies anyway.

@shrugs
Copy link
Contributor Author

shrugs commented Nov 29, 2017

@frangio added the rules and applied an autofix. We'll want to squash that commit correctly before merging, most likely.

@shrugs shrugs force-pushed the feat/minor-additions branch from 613d8df to ac38088 Compare December 1, 2017 11:44
@shrugs
Copy link
Contributor Author

shrugs commented Dec 1, 2017

rebased and updated; sqashed the semicolon fix to 8662846

@frangio
Copy link
Contributor

frangio commented Dec 1, 2017

Thanks so much @shrugs! 🙌

@frangio frangio merged commit dd1fd00 into OpenZeppelin:master Dec 1, 2017
@shrugs shrugs deleted the feat/minor-additions branch December 1, 2017 15:47
@AugustoL
Copy link
Contributor

Seeing this just now, @shrugs 👏 👏

ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this pull request Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants