Giter Site home page Giter Site logo

Header Creation about stylecop HOT 10 CLOSED

stylecop avatar stylecop commented on July 21, 2024
Header Creation

from stylecop.

Comments (10)

meh-uk avatar meh-uk commented on July 21, 2024

I've seen that too actually. Very annoying.

from stylecop.

citizenmatt avatar citizenmatt commented on July 21, 2024

What are you expecting to see? Any chance you could attach (or gist) the settings?

from stylecop.

mayermart avatar mayermart commented on July 21, 2024

I expect to see nothing, but i see:
// --------------------------------------------------------------------------------------------------------------------
//
//
//
// --------------------------------------------------------------------------------------------------------------------

Settings: https://gist.github.com/mayermart/5d054d1d2fbd72ac2d5a

from stylecop.

DevHim avatar DevHim commented on July 21, 2024

I have the same problem, this is how the settings file look:

image

After running code-cleanup (where Stylecop rules are enabled) I get this, which I do not want:

image

Are we missing some setting, or what?

from stylecop.

jplopes avatar jplopes commented on July 21, 2024

I also noticed that having this in the File Header Text configuration:

--------------------------------------------------------------------------------------------------------------------
<copyright file="$FILENAME$" company="CompanyName">
    Copyright (c) CompanyName. All rights reserved.
</copyright>
<summary>
</summary>
--------------------------------------------------------------------------------------------------------------------

when I run a cleanup i was expecting to see this:

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ClassName.cs" company="CompanyName">
//   Copyright (c) CompanyName. All rights reserved.
// </copyright>
// <summary>
//   The ClassName.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

instead I got this:

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ClassName.cs" company="">
// 
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

Thank you.

from stylecop.

citizenmatt avatar citizenmatt commented on July 21, 2024

@jplopes Do you have a config that can replicate this? I've found an issue where the plugin wasn't reading the settings files correctly, and I suspect it's fixed the issue, but it would be nice to test.

from stylecop.

jplopes avatar jplopes commented on July 21, 2024

Hope this helps:
Settings.StyleCop.txt
Thank you!

from stylecop.

citizenmatt avatar citizenmatt commented on July 21, 2024

Is that the right settings file? The CompanyName and Copyright StringProperty elements are in the wrong place - they should be in the AnalyzerSettings element of the DocumentationRules section. If I move them (and I'm working with my fixed-reading-settings version) they appear as expected.

However, the summary doesn't appear, because by default, the FileHeaderMustHaveSummary rule is disabled, and you're not overriding it in your settings file. Also, there isn't any file header text configuration template like you listed.

from stylecop.

jplopes avatar jplopes commented on July 21, 2024

Hi again,
Sorry, I did a really bad job at explaining myself.
The File Header Text configuration I was referring to is in Resharper->Options->Code Editing->File Header Text. I was hoping that having this filled in would override StyleCop Settings (if it makes any sense). Anyway, from what I now understand from your explanation, my settings where all wrong for what I was expecting to get. Sorry for wasting your time. Keep up the awesome work you've been doing with the "million" Resharper plugins you maintain. Thank you.

from stylecop.

citizenmatt avatar citizenmatt commented on July 21, 2024

Hmm. Yeah, I need to think about the overlap between ReSharper's file header and StyleCop. The current implementation kind of ignores this, but we'd get different results if the settings came from ReSharper rather than settings.stylecop. I'll open a new issue. Cheers! 👍

from stylecop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.