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

rules to improve #169

Open
4 tasks
duaraghav8 opened this issue Jan 23, 2018 · 27 comments
Open
4 tasks

rules to improve #169

duaraghav8 opened this issue Jan 23, 2018 · 27 comments

Comments

@duaraghav8
Copy link
Owner

duaraghav8 commented Jan 23, 2018

  • indentation - doesn't lint for indent inside the assembly block, also currently doesn't account for the new syntax for defining contract constructor (constructor() - solparse node type ConstructorDeclaration)
  • lbrace - currently doesn't account for the new syntax for defining contract constructor (constructor() - solparse node type ConstructorDeclaration)
  • no-empty-blocks rule completely ignores Function declarations. It should only ignore fallaback functions, other functions should be flagged if they have empty body.
  • All whitespace-related rules

NOTE: Changes in rules should pass existing test cases and also add new test cases to test the changes thoroughly

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 120.0 DAI (120.0 USD @ $1.0/DAI) attached to it.

@nemani
Copy link
Contributor

nemani commented Jul 14, 2018

@duaraghav8 This and #94 Seem very similar. @ceresstation
Can you both figure out how exactly these 2 issues will be done? As there seems to be (a possibility of) redundant work.

@gomesalexandre
Copy link

Indeed, they seem to overlap @nemaniarjun

@duaraghav8
Copy link
Owner Author

duaraghav8 commented Jul 16, 2018

@nemaniarjun @gomesalexandre @aerophile there is no overlap. 1 issue exclusively focuses on the fix() function, which is written regardless of how its surrounding code looks like (of course, it needs some info about the solidity code to know what to replace/add/delete).

The other issue focuses on improvement in the sense that the rule itself is written very poorly (for which I am to blame). So it primarily requires refactoring and completing the set of checks the rule must actually be performing.
For refactoring, see a few examples of rules that were written more recently using better practices:
https://github.com/duaraghav8/Solium/blob/master/lib/rules/function-order.js | https://github.com/duaraghav8/Solium/blob/master/lib/rules/max-len.js | https://github.com/duaraghav8/Solium/blob/master/lib/rules/quotes.js.
The older rule implementations need to see similar improvements.

And if a check is not yet present, then you need not worry about implementing a fix for that. eg- if indentation doesn't check indent used by array items declared over multiple lines (at the time when you're developing fixes for that rule), then you need not write a fix for that and your PR will still be accepted.

To simplify things, please work on the bounties in the following order:

  1. implement fix()es for current rule implementations
  2. Once these fixes are merged, then work on the rule improvement issue

Sorry for the confusion. Hope I cleared things now? Please let me know if there is any further clarification you need.

@mkosowsk
Copy link

@writeprovidence with the previous comment, do you have the information and tools you need to solve this issue? :)

@writeprovidence
Copy link

@mkosowsk i think i do. will definately ask questions if need be

@mkosowsk
Copy link

@writeprovidence just a friendly check-in here 😀 have you had a chance to take a look at this issue?

@writeprovidence
Copy link

writeprovidence commented Jul 27, 2018 via email

@duaraghav8
Copy link
Owner Author

@writeprovidence let me know if it's something you aren't able to figure out from the docs

@writeprovidence
Copy link

writeprovidence commented Jul 28, 2018 via email

@gitcoinbot
Copy link

gitcoinbot commented Aug 6, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 1 year, 5 months ago.
Please review their action plans below:

1) mridulnagpal has started work.

If this is still open I would love to work on this issue
2) dhamaniasad has started work.

If there's still interest in fixing this issue I'd like to take it up.
3) raininja has started work.

I plan to identify the issues described in the description and correct them as requested.
4) vporton has started work.

I plan to identify the issues described in the description and correct them as requested.

Learn more on the Gitcoin Issue Details page.

@nemani
Copy link
Contributor

nemani commented Aug 9, 2018

@duaraghav8 Can you tell me which all rules are still open to work on? I finally have some time to do this!
😄

@duaraghav8
Copy link
Owner Author

Hey @nemaniarjun, sorry for replying so late. All rules are still open. There was only 1 PR opened a while ago but I it hasn't been worked on for a while so I'll favour another PR over it.

@oogetyboogety
Copy link

@duaraghav8 is there a special set of rules to indent for assembly blocks? or should they all be indented one level deeper at the same level in the assembly block?
Also, what should be done for the whitespace rules?

Thanks!

@duaraghav8
Copy link
Owner Author

ah, sorry I didn't write a proper description for whitespace rules.
currently, they're written very poorly - hacks put together through regular expressions.
what is needed primarily is the refactoring of whitespace rules such that they pass all existing tests, use ES6 and become much more maintainable (ie use good JS practices).

there's no separate rule for indenting assembly, all indentation-related checks are in a single rule file.

@oogetyboogety
Copy link

@duaraghav8 Thanks I'll take a look at refactoring the whitespace rule for the tests and try some ES6 best practices that I know of.

is there any specific assembly style indentation/style guide you would like to follow? or should all inline assembly be on the same column, unless there is a label to jump to or an additional block in the assembly, and that's it; an example of this is here:
https://github.com/androlo/solidity-workshop/blob/master/tutorials/2016-04-04-solidity-inline-assembly-I.md

@duaraghav8
Copy link
Owner Author

All on same column + indentation for labels or blocks (because that is more natural and intuitive for end user)

@PixelantDesign
Copy link

Hello duaraghav8! This is Alisa from Gitcoin. Is this issue still active?

@duaraghav8
Copy link
Owner Author

Hey Alisa, The issue on the project is still active.
I'm unsure of its status on Gitcoin. If it is open on Gitcoin, feel free to close it as I don't see anyone taking this up.

@raininja
Copy link

I can give this a whirl @duaraghav8, I'm already familiar with the codebase, what say you?

@raininja
Copy link

It's still open, can I take it?
@duaraghav8
@PixelantDesign

@raininja
Copy link

Tried to "start work" but the bounty was taken by another user

@raininja
Copy link

So nothing is being done on this?

@duaraghav8
Copy link
Owner Author

@raininja I'm no longer sure whether the bounties are still valid or not. I can confirm that the issue is still active @PixelantDesign but not sure if the bounty still applies or not.

@spm32
Copy link

spm32 commented Sep 23, 2019

Hi @raininja you are welcome to take this one on if you have time, I'll even add a tip. Just approved you.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 120.0 DAI (120.0 USD @ $1.0/DAI) has been submitted by:

  1. @vporton

@ceresstation please take a look at the submitted work:


@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 120.0 DAI (120.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @vporton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants