Ethlint icon indicating copy to clipboard operation
Ethlint copied to clipboard

rules to improve

Open duaraghav8 opened this issue 6 years ago • 27 comments

  • [ ] 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

duaraghav8 avatar Jan 23 '18 04:01 duaraghav8

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.

gitcoinbot avatar Jul 13 '18 09:07 gitcoinbot

@duaraghav8 This and https://github.com/duaraghav8/Solium/issues/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.

nemani avatar Jul 14 '18 18:07 nemani

Indeed, they seem to overlap @nemaniarjun

gomesalexandre avatar Jul 15 '18 07:07 gomesalexandre

@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.

duaraghav8 avatar Jul 16 '18 03:07 duaraghav8

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

mkosowsk avatar Jul 18 '18 20:07 mkosowsk

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

writeprovidence avatar Jul 19 '18 15:07 writeprovidence

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

mkosowsk avatar Jul 26 '18 20:07 mkosowsk

still trying to figure out something

On Thu, Jul 26, 2018 at 8:14 PM, mkosowsk [email protected] wrote:

@writeprovidence https://github.com/writeprovidence just a friendly check-in here 😀 have you had a chance to take a look at this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/duaraghav8/Solium/issues/169#issuecomment-408221269, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad6C1ZlL4u769asO01Xyo_V1bBRp6AsGks5uKiMygaJpZM4RpC_X .

writeprovidence avatar Jul 27 '18 09:07 writeprovidence

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

duaraghav8 avatar Jul 28 '18 06:07 duaraghav8

ok

On Sat, Jul 28, 2018 at 6:47 AM, Raghav Dua [email protected] wrote:

@writeprovidence https://github.com/writeprovidence let me know if it's something you aren't able to figure out from the docs

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/duaraghav8/Solium/issues/169#issuecomment-408587408, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad6C1cDXnupNKqnGkQNHudChsCxrAig0ks5uLAkMgaJpZM4RpC_X .

writeprovidence avatar Jul 28 '18 15:07 writeprovidence

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.

gitcoinbot avatar Aug 06 '18 07:08 gitcoinbot

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

nemani avatar Aug 09 '18 00:08 nemani

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.

duaraghav8 avatar Aug 21 '18 04:08 duaraghav8

@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!

oogetyboogety avatar Oct 11 '18 04:10 oogetyboogety

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.

duaraghav8 avatar Oct 12 '18 03:10 duaraghav8

@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

oogetyboogety avatar Oct 12 '18 05:10 oogetyboogety

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

duaraghav8 avatar Oct 14 '18 14:10 duaraghav8

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

PixelantDesign avatar May 31 '19 09:05 PixelantDesign

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.

duaraghav8 avatar May 31 '19 11:05 duaraghav8

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

raininja avatar Aug 10 '19 16:08 raininja

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

raininja avatar Aug 13 '19 13:08 raininja

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

raininja avatar Aug 13 '19 18:08 raininja

So nothing is being done on this?

raininja avatar Aug 24 '19 15:08 raininja

@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.

duaraghav8 avatar Aug 31 '19 10:08 duaraghav8

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

spm32 avatar Sep 23 '19 21:09 spm32

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:

  • PR by @vporton

gitcoinbot avatar Jan 13 '20 19:01 gitcoinbot

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.

gitcoinbot avatar Jan 27 '20 19:01 gitcoinbot