Ethlint icon indicating copy to clipboard operation
Ethlint copied to clipboard

Write autofix functions for existing rules

Open duaraghav8 opened this issue 7 years ago • 40 comments

  • [ ] indentation - is a top priority (is also very complicated and indentation rules needs to be re-written in simpler way before we implement its autofix)
  • [ ] whitespace
  • [ ] lbrace
  • [x] pragma-on-top's inspectExperimentalPragmaStatement()
  • [x] imports-on-top
  • [x] blank-lines
  • [ ] operator-whitespace
  • [ ] function-ordering
  • [x] array-declarations
  • [x] deprecated-suicide
  • [x] pragma-on-top
  • [x] quotes
  • [x] emit

See dev guide on how to implement fix()es for rules.

duaraghav8 avatar Aug 04 '17 05:08 duaraghav8

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


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

gitcoinbot avatar Jul 04 '18 18:07 gitcoinbot

cc @nemaniarjun (if you're interested)

duaraghav8 avatar Jul 05 '18 02:07 duaraghav8

I would be interested, but I am busy this week, maybe able to pick this up after the 15th. Also, I would suggest breaking the bounty into smaller parts / or making it a "Co-operative" bounty, which will result in faster work IMO.

nemani avatar Jul 05 '18 06:07 nemani

If this is still opened, I could have a look at it this week-end. I really like what you guys do for Solidity devs experience so that would be a good first contribution to get familiar with the project.

gomesalexandre avatar Jul 06 '18 14:07 gomesalexandre

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


Work has been started.

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

1) ihordiachenko has started work.

I'm going to start with the operator-whitespace rule to get familiar with the ethlint internal APIs. If the PR is fine for you, I'll assess the remaining rules.

Learn more on the Gitcoin Issue Details page.

gitcoinbot avatar Jul 07 '18 14:07 gitcoinbot

Thanks @gomesalexandre :) Let me know if you face any problems

duaraghav8 avatar Jul 08 '18 05:07 duaraghav8

  • operator-whitespace is working, needs tests
  • As far as function-ordering goes I've spent a few hours on it without success yet. It is not working, as in not fixing everything in one go, you have to run the command a few times before everything becomes in correct order. My question is, is there a way to directly interact with the array of function node objects and modify their order, then "reinject it" or do you absolutely have to use the fixer helper ? If it's the former, I got the logic pretty much done already, if the latter I'll need more time !

gomesalexandre avatar Jul 08 '18 17:07 gomesalexandre

directly interact with the array of function node objects and modify their order - No. The number of edge cases to deal with when directly modifying the AST outweigh the benefits, so I never went ahead with it. I understand the problem you're facing with func order. There seems to be no easy solution to this. The best I can think of will be a nightmare to maintain down the line (I'll be happy to describe it to you). So I guess, we'll just have to abandon the fix function for this rule.

duaraghav8 avatar Jul 08 '18 18:07 duaraghav8

I see your point, makes sense. It's always good to have sane abstractions like the fixer one. That's also the approach that eslint took and is a way safer and maintainable one. I'll be happy to hear about that solution, in the meantime I'll check the other rules !

gomesalexandre avatar Jul 08 '18 18:07 gomesalexandre

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


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

gitcoinbot avatar Jul 13 '18 10:07 gitcoinbot

@aerophile I am not sure why this was reopened by the Gitcoin bot, however, it's a collaborative bounty so feel free to take on the rules I haven't worked on 👍 I started work on function-order and operator-whitespace already (see PR here) so you could start working on the other rules, as I plan to finish these by next week.

gomesalexandre avatar Jul 14 '18 18:07 gomesalexandre

sure @gomesalexandre, considering that the remaining three items are common to this and #169 It will be better to get inputs from @duaraghav8 before proceeding to avoid redundant work.

aerophile avatar Jul 15 '18 21:07 aerophile

@duaraghav8 @aerophile Pushed some more fixes for operator-whitespace, I miss a few more autofixes on this one that I plan on fixing tomorrow, and also finish function-order if I have time. From there, it also means that improving operator-whitespace (as part of #169) can be done by whoever wants to !

gomesalexandre avatar Jul 17 '18 19:07 gomesalexandre

@gomesalexandre @duaraghav8 Just an update from my side: Have been reading documentation and really got the gist of what solium is and how rules and fixing work. I really appreciate the architectural choices made in v1.0+ . I think I'll be working on the autofix functions for lbrace and whitespace.

aerophile avatar Jul 21 '18 15:07 aerophile

Hi @gomesalexandre and @duaraghav8, just a friendly check-in here 😀 how are things coming along?

mkosowsk avatar Jul 26 '18 20:07 mkosowsk

Hey @mkosowsk unfortunately I didn't have time to continue the work on it yet. I'll try to push the two rules' missing autofixes on Sunday night Paris time (in 48 hours essentially), but can't confirm 😞. If I didn't push it by then, feel free to write the remaining fixes, including the ones for these two(you can fork my fork and use that as a basis !)

gomesalexandre avatar Jul 27 '18 17:07 gomesalexandre

Hi @aerophile per @gomesalexandre last comment, do you think you have the tools to run with this issue? Thanks!

mkosowsk avatar Aug 01 '18 01:08 mkosowsk

Hey @aerophile @gomesalexandre just wanted to follow up on this once more, any updates?

spm32 avatar Aug 13 '18 23:08 spm32

@ceresstation Expecting to update and complete by this weekend

aerophile avatar Aug 15 '18 17:08 aerophile

Hey @aerophile did you manage to find time to finish this up over the weekend as mentioned?

spm32 avatar Aug 21 '18 16:08 spm32

@ceresstation I did spend time over the weekend but I'm still on it. I plan to continue.

aerophile avatar Aug 22 '18 20:08 aerophile

@aerophile Hey there, we haven't heard back from you in a while, are you still working on this?

spm32 avatar Sep 18 '18 18:09 spm32

@aerophile - pinging again to see if you're still working on this!

frankchen07 avatar Oct 24 '18 22:10 frankchen07

hi i would like to konw if this bounty is still open? if yes which rules remains to be implemented? thanks

codi45 avatar Oct 25 '18 23:10 codi45

hey @duaraghav8, Frank from Gitcoin here, is this issue still open for @codi45?

frankchen07 avatar Oct 26 '18 18:10 frankchen07

@frankchen07 hey even I haven't heard from aerophile so if this issue is not already open but @codi45 is keen on working on it, could you help re-open it on gitcoin? Because I now consider this issue to be open again to hunters

duaraghav8 avatar Oct 29 '18 03:10 duaraghav8

Hi @duaraghav8 yes i would like to start and will want to know the issues because i try the lbrace rule and it is working correctly if the brackets are there or not so i would to know more about the fix.

codi45 avatar Oct 29 '18 14:10 codi45

@codi45 & @duaraghav8 - yep the issue is still open! https://gitcoin.co/issue/duaraghav8/Solium/94/722

frankchen07 avatar Oct 29 '18 20:10 frankchen07

Hey @codi45 are you still interested in trying out this issue?

spm32 avatar Nov 06 '18 16:11 spm32

Hey, @duaraghav8 @ceresstation is this issue still open?

dev1644 avatar Jan 03 '19 11:01 dev1644

@dev1644 going by the issue details page, yes it is open. I'd still wait for @ceresstation's confirmation

duaraghav8 avatar Jan 03 '19 12:01 duaraghav8

@duaraghav8 Ok, once @ceresstation confirm it, I will start working on it.

dev1644 avatar Jan 03 '19 12:01 dev1644

Hey @dev1644 really sorry for the delay, you're good to go here!

spm32 avatar Jan 23 '19 02:01 spm32

Hey @duaraghav8. Is the bounty still attached to this issue?

ihordiachenko avatar Aug 01 '19 20:08 ihordiachenko

Hi @ihordiachenko it should be, if you can get the remaining tasks complete that would be super helpful.

spm32 avatar Aug 01 '19 21:08 spm32

@ihordiachenko Let me know in case you have any doubts

duaraghav8 avatar Aug 02 '19 18:08 duaraghav8

@ceresstation @duaraghav8 cool, I'll give it a shot next week

ihordiachenko avatar Aug 03 '19 20:08 ihordiachenko

@duaraghav8 autofix for the operator-whitespace rule is ready. Could you take a look at it?

https://github.com/duaraghav8/Ethlint/pull/270

ihordiachenko avatar Aug 12 '19 19:08 ihordiachenko

@ihordiachenko sorry for the late response, I had been on leave for a while. Thanks for the PR, will review it in a day's time.

duaraghav8 avatar Aug 31 '19 10:08 duaraghav8

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, 8 months ago. Please review their action plans below:

1) akanimorex has started work.

i am very proficient in javascript and i can work on this if this is still open

Learn more on the Gitcoin Issue Details page.

gitcoinbot avatar Apr 26 '20 20:04 gitcoinbot