Skip to content

Fixed all compiler warnings #675

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

Merged
merged 20 commits into from
Feb 12, 2020
Merged

Fixed all compiler warnings #675

merged 20 commits into from
Feb 12, 2020

Conversation

bart-degreed
Copy link
Contributor

@bart-degreed bart-degreed commented Jan 24, 2020

Fixed all compiler warnings, except:

CS1591: Missing XML comment for publicly visible type or member

because it is a massive amount of work to fix all of those.

So I set builds to fail on compiler warnings in release mode, but with a suppression rule for CS1591. The suppression can be removed once all documentation has been updated. Until then, this should help to protect against accidentally introducing new build warnings.

I also corrected broken RelationshipAttribute.Equals implementation.

Bart Koelman added 15 commits January 24, 2020 17:27
Also corrected Equals implementation and set builds to fail on compiler warnings in release mode.
…isible type or member" because it is a massive amount of work to fix all of those.
…abled for Debug)

The project type GUID was changed by VS 2019 v16.4.3 automatically. According to https://stackoverflow.com/questions/47312163/dotnet-sln-add-wrong-project-type-guid, this seems like a good thing.
@bart-degreed
Copy link
Contributor Author

Resolved merge conflicts.

@maurei
Copy link
Member

maurei commented Feb 12, 2020

Thanks for this. I myself have tried to use StyleCop for linting to prevent many of these warnings from occuring in the first place, but unfortunately it does not work properly yet with Visual Studio for Mac, see this issue.

@maurei maurei self-requested a review February 12, 2020 01:11
Copy link
Member

@maurei maurei left a comment

Choose a reason for hiding this comment

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

So I set builds to fail on compiler warnings in release mode,

Perhaps we should consider setting this option for both the release and debug configurations, considering that one usually just builds a debug locally and is likely to be caught by surprise by a failing CI build because of the differing configuration? What do you think?

@bart-degreed
Copy link
Contributor Author

The reason I set warning-as-error for release builds only is to ensure warnings are resolved before commit to master, but do not get in your way when writing, refactoring and debugging code. For example, commenting out code or adding a temporary variable for inspection often causes compiler warnings like "unused variable" and "unreachable code", which is annoying. If anyone wants to prevent a failing CI build, they should check the warnings window in VS is empty before push.

For the same reason, I don't like StyleCop. It bothers me all the time with syntax-violation squiggles and I find that very distracting. When I'm ready to optimize and cleanup, I'll deal with the styling issues. Like I mentioned elsewhere, there are better tools out there to ensure a common style, while not getting in your way.

@maurei
Copy link
Member

maurei commented Feb 12, 2020

Good point, turning it on for debugging would make it hard to iterate quickly during dev, I agree with that 👍. I haven't come across any other projects in my career though for which this option was enabled, and also this project hasn't had it enabled in the past. As such I've gone ahead to add a section about this in the README for anyone wanting to get (back) into JADNC development.

@maurei maurei self-requested a review February 12, 2020 20:25
@maurei maurei merged commit 33cf4a6 into json-api-dotnet:master Feb 12, 2020
@bart-degreed bart-degreed deleted the fix-compile-errors branch February 12, 2020 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants