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

Group classes by function or type #196

Merged

Conversation

neomatrix369
Copy link
Contributor

@neomatrix369 neomatrix369 commented Jun 16, 2019

On the back of #194 I have started to slowly group together classes, methods/functions, fields/variables that come across as fulfilling similar functionality.

For this sweep I picked these 3 categories:

  • Language support
  • OS/Arch/Platform
  • Suite

Doing this should help identify temporal coupling, preparing the file for refactoring later on.

I re-ran the graal build via https://circleci.com/gh/neomatrix369/awesome-graal/503 which builds this particular repo and branch.

Build status of this branch: CircleCI

@@ -0,0 +1,12 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this file?

Copy link
Contributor Author

@neomatrix369 neomatrix369 Jun 17, 2019

Choose a reason for hiding this comment

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

To enable running checks done by this command, before creating a PR, its similar to what you have done in the travis-ci builds

Copy link
Member

Choose a reason for hiding this comment

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

Ok but I don't think we need it in the repo. Can you please remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Removed!

@dougxc
Copy link
Member

dougxc commented Jun 17, 2019

Given the size of the diff with all this rearranging, please make sure the PR contains only rearranging so that it should be trivially equivalent to the original code. Note that there's still a risk in breakage when moving module level statements (which includes class and method definitions) but hopefully our gate with catch any problems related to that.

@neomatrix369
Copy link
Contributor Author

Given the size of the diff with all this rearranging, please make sure the PR contains only rearranging so that it should be trivially equivalent to the original code. Note that there's still a risk in breakage when moving module level statements (which includes class and method definitions) but hopefully our gate with catch any problems related to that.

Yes I have taken care to see there is no reason for breakage - the IDE is helping, plus I'm building using the build script to run the changed version of mx each time. These changes are just moving the blocks closer to each other so they can be extracted.

There is still a chance of breakage, and this could indicate to us something when it happens either code that needs fixing, usually less optimal couplings can cause it.

@neomatrix369
Copy link
Contributor Author

I'll rebase mx.py to fix the conflict reported by github.

@dougxc
Copy link
Member

dougxc commented Jun 17, 2019

Please don't rebase. If I cannot resolve conflicts when integrating, I'll reach out for help. Please let me know once you're ready for me to try integrate this PR.

@neomatrix369
Copy link
Contributor Author

Please proceed, this PR is good to go!

@neomatrix369
Copy link
Contributor Author

@dougxc any chance of this being reviewed if you have the bandwidth?

@dougxc
Copy link
Member

dougxc commented Jul 4, 2019

I'm trying to integrate it now.

@gilles-duboscq
Copy link
Member

For anybody ever needing to review this kind of changes, this was reviewed using this script based on an idea from @ansalond.
This cuts the top-level declarations of a python script into files that can then easily be processed by diff.

@neomatrix369
Copy link
Contributor Author

For anybody ever needing to review this kind of changes, this was reviewed using this script based on an idea from @ansalond.
This cuts the top-level declarations of a python script into files that can then easily be processed by diff.

Thanks for letting us know.

Let's hope we don't have to do reviews on such file for long!

@neomatrix369
Copy link
Contributor Author

I'm trying to integrate it now.

Thanks!

@graalvmbot graalvmbot merged commit 8a33403 into graalvm:master Jul 4, 2019
@neomatrix369 neomatrix369 deleted the group-classes-by-function-or-type branch July 4, 2019 21:17
@neomatrix369
Copy link
Contributor Author

neomatrix369 commented Jul 5, 2019

For anybody ever needing to review this kind of changes, this was reviewed using this script based on an idea from @ansalond.
This cuts the top-level declarations of a python script into files that can then easily be processed by diff.

Good work with the script - nice work! I just applied it to the PR #197

I think the cut.py script should be made part of the python repos like mx under some folder i.e. dev-tools or dev-utils so everyone can use it for reviewing large source files.

@neomatrix369
Copy link
Contributor Author

For anybody ever needing to review this kind of changes, this was reviewed using this script based on an idea from @ansalond.
This cuts the top-level declarations of a python script into files that can then easily be processed by diff.

I have created a bash script which can be run after running your cut.py script, see https://gist.github.com/neomatrix369/a945d9766ccedceadf37b97e467eeab7

Using diff it gathers the files that are different and captures the differences which can later be posted in a diff.

@gilles-duboscq
Copy link
Member

I think the cut.py script should be made part of the python repos like mx under some folder i.e. dev-tools or dev-utils so everyone can use it for reviewing large source files.

I think it is (and should remain!) rather rare to make changes that shuffle everything around. It is not about reviewing large source files (the standard tools do that just fine), it's about reviewing changes which just re-order a lot of things (regardless of the size of the files).

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

Successfully merging this pull request may close these issues.

4 participants