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
Small Refactoring Changes - First Contribution on Github Open Source #493
base: master
Are you sure you want to change the base?
Conversation
…ands under TwitchClient
…in CustomPath class
…tus in Helper Class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I am not in any way, shape, or form related to this project and I have absolutely no say in what will and will not be accepted into the repository. I also do not write Java, so I cannot comment on Java language specific things.
That said, I did notice some code style things where your changes deviate from the code style of the surrounding code, which I just wanted to highlight, since this is something you will want to pay attention to regardless of the project/codebase you choose (or get hired) to contribute to in the future.
I point out a lot of specific cases, but I eventually gave up on pointing all of them out. The ones I have pointed out should help you be able to see how your personal coding style differs from the project’s coding style and thus how you should adjust to make your code more palatable for upstream.
Good luck on your free software journey! :)
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be mindful of adding extra blank lines if the codebase otherwise separates functions/methods by a single blank line.
this.customDir = null; | ||
this.invalidCustomDir = path.toString(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, be mindful of actually adding a blank line to separate methods if that’s what the surrounding/existing code does.
} | |
} | |
|
||
|
||
private static HashMap<String,Boolean> setPossibleChannelType(String[] catSplit, HashMap<String,Boolean> channelType){ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other methods don’t seem to have a blank line at their beginning.
addValidChannel(chan, prepend, result); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, whitespace helps readability, esp. if there’s consistency in how they’re used. :)
} | |
} | |
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is changed here? Did you change the line ending? It doesn’t look like either line had/has trailing whitespace… ?
private static void getPossibleChannelNames(String channel, boolean prepend, Set<String> result){ | ||
String[] channelTypes = new String[]{"noChans","onlyChans","onlyLive"}; | ||
HashMap<String,Boolean> channelTypeHM = new HashMap<>(); | ||
for(String channelType: channelTypes){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- In existing code
for
and its(
are separated by a space. - In existing code that you’re replacing the
Type variable : class
uses:
. ){
as mentioned elsewhere.
for(String channelType: channelTypes){ | |
for (String channelType : channelTypes) { |
@@ -3381,7 +3382,11 @@ private void checkPointsListen(User user) { | |||
pubsub.listenPoints(user.getStream(), settings.getString("token")); | |||
} | |||
} | |||
|
|||
|
|||
private boolean isEventForUserBasedOnScope(String scope, User user){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
){
p.invalidCustomDir = null; | ||
p.customInfo = info; | ||
} | ||
p.setCustomValuesForObject(path,info,requireExists); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing code uses a space after comma for passing parameters.
p.setCustomValuesForObject(path,info,requireExists); | |
p.setCustomValuesForObject(path, info, requireExists); |
|
||
for (int i = 1; i < catSplit.length; i++) { | ||
if (catSplit[i].equals("#")) { | ||
channelType.put("onlyChans",true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter spaces.
addValidChannel(chan, prepend, result); | ||
} | ||
} | ||
getPossibleChannelNames(channel,prepend,result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter spaces.
getPossibleChannelNames(channel,prepend,result); | |
getPossibleChannelNames(channel, prepend, result); |
Hey there!
Ishan here, excited to share my first attempt at applying some Refactoring techniques! I've been looking for ways to practice my skills, and this project caught my eye as the one I'd love to contribute to.
I'm passionate about coding and always looking for ways to improve my craft. Refactoring is a great way to do just that, and I'm thrilled to be able to apply these techniques to this project.
Thanks for taking the time to consider my pull request. I can't wait to see where this project goes and how I can continue to contribute!
Best regards,
Ishan