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

Cosmetic changes to LocalizationTable class #425

Merged
merged 6 commits into from
Aug 21, 2016
Merged

Cosmetic changes to LocalizationTable class #425

merged 6 commits into from
Aug 21, 2016

Conversation

Grenkin1988
Copy link
Contributor

#375 Second try after all changes merged

{
// The loop is searching for a value. Add the current char, regardless of what it is.
currentValue += c;
throw new InvalidOperationException(string.Format("Invalid format of localization string. Actual {0}", line));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure about throwing exceptions here? For the record, I prefer crashing rather than having bad data. But in the rest of the code is seems more common to log error and then put an empty string there or something. You should maybe make sure that whoever calls initialize is prepared to catch the exception.

Choose a reason for hiding this comment

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

At the very least make sure to log it

Copy link
Contributor Author

@Grenkin1988 Grenkin1988 Aug 20, 2016

Choose a reason for hiding this comment

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

@Mizipzor
At work I have practice - crash early. This could happen if someone provided bad date in localization file. This should be spotted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, yes, yes I couldnt agree more. Crash early, crash often, I say. Maybe this should be discussed and settle on a standard. I have a feeling we are the minority. :P

Choose a reason for hiding this comment

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

Crash early, crash often. Only if needed though. Doesn't make sense to crash on the user machine. You want to crash on dev machines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@OzieGamma This is release or development still? How do you prefer to catch that someone screwed up with localization files?

Choose a reason for hiding this comment

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

In a testing environment. Not sure about this particular case, my comment was general

@Grenkin1988
Copy link
Contributor Author

@Mizipzor @OzieGamma Changed exception trowing with logging. Added line in the end

@alexanderfast
Copy link
Collaborator

Awesome.

I would like to take this opportunity to highlight another cool Github feature. Do you see the discussions we had before, now that the lines have changes, that they are collapsed, since they are out of date? :)

@Grenkin1988
Copy link
Contributor Author

@Mizipzor Yes, interesting feature.

@Grenkin1988
Copy link
Contributor Author

Grenkin1988 commented Aug 20, 2016

@Mizipzor If I installed StyleCop to my Visual Studio where should I get configurations for in from?

@alexanderfast
Copy link
Collaborator

alexanderfast commented Aug 20, 2016

Theres the StyleCop wiki, but in short:

  1. Install StyleCop if it isnt installed (it should be).
  2. Get latest master.
  3. Run StyleCop under Tools.
  4. Stuff it finds is where compile warnings are.
  5. And we have a lot of them, you probably want sort on file in that table and only look at relevant files.

@Grenkin1988
Copy link
Contributor Author

@Mizipzor So I do not need to configure it? It is already done on project level and my instance know what to do?

@alexanderfast
Copy link
Collaborator

You dont need to configure it, thats the point. :) There should be a Settings.StyleCop right next to the solution file.

@alexanderfast
Copy link
Collaborator

Isn't it nice that you don't have to discuss this? You get a list of stuff to do, without room for interpretation, and you do it. And no one needs to be nagging. :)

@vogonistic vogonistic merged commit 67d0a06 into TeamPorcupine:master Aug 21, 2016
@vogonistic
Copy link
Collaborator

Merged!

@Grenkin1988 Grenkin1988 deleted the loc-cosmetic branch August 21, 2016 05:37
NogginBops pushed a commit to NogginBops/ProjectPorcupineOld that referenced this pull request Aug 21, 2016
* Cosmetic changes to LocalizationTable class

* Cosmetic changes to LocalizationTable class

* Changed exception trowing with logging. Added line in the end

* Fixed most of StyleCop warnings
NogginBops pushed a commit to NogginBops/ProjectPorcupineOld that referenced this pull request Aug 21, 2016
* Cosmetic changes to LocalizationTable class

* Cosmetic changes to LocalizationTable class

* Changed exception trowing with logging. Added line in the end

* Fixed most of StyleCop warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants