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

C# auto-generated header for generated c# codec files #814

Merged
merged 2 commits into from
Sep 15, 2020

Conversation

mhoogveld
Copy link
Contributor

Adding the header to generated .cs files will cause them to be ignored by Visual Studio's code-inspection, which will speed up the IDE.
Also changed to file-extension from *.cs to *.g.cs, which has exactly the same result in Visual Studio, but can also be used by other tools (e.g. Git's .gitignore or Visual Studio's .editorconfig)

The *.g.cs extension is mentioned in various places and is used since VS 2008 or earlier, but there does not seem to be any official documentation.
The best reference I found regarding the extension is https://developers.google.com/protocol-buffers/docs/reference/csharp-generated

@mjpt777 mjpt777 requested a review from JPWatson August 25, 2020 08:08
@mjpt777
Copy link
Contributor

mjpt777 commented Aug 25, 2020

@billsegall Do you have a view on this?

@billsegall
Copy link
Contributor

billsegall commented Aug 25, 2020 via email

@mjpt777
Copy link
Contributor

mjpt777 commented Aug 26, 2020

Please ensure the build passes all tests before submitting.

…e top of each generated C# file.

Auto-generated files are not included in automatic code-cleanup and/or inspection processes.
Like the auto-generated tag in the file's header, this causes files to be recognized as auto-generated code by Visual Studio.
An added bonus of the filename change is that these files can be treated differently based on the filename in your project's .gitignore or .editorconfig files
@mhoogveld
Copy link
Contributor Author

@billsegall I'm not sure what .gitignore file(s) you refer to.
The .gitignore in the root directory already includes all generated c# code in /csharp/sbe-generated by ignoring directories themselves or *.cs files in them (which also include the *.g.cs files of course)

@mjpt777 If I'm correct, the failing test already fails in the commit in the master on which this branch is based.
Would you like me to to rebase this branch onto another existing commit?

@mhoogveld mhoogveld closed this Sep 14, 2020
@mhoogveld mhoogveld reopened this Sep 14, 2020
@mjpt777 mjpt777 merged commit 7f00e1f into real-logic:master Sep 15, 2020
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.

None yet

3 participants