Visual Studio For Mac Stylecop

Автор:

Join GitHub today

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up

Screenshot of Visual Studio editing a.ruleset file, disabling StyleCop rules. There are multiple ways to lint C# for code formatting, styling inconsistencies, plus.

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

Labels
Download

Comments

commented Aug 15, 2017

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.4)

Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fd

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.4

VS Code version: 1.15.0
C# Extension version: 1.12.1

Steps to reproduce

Follow the steps here to enable StyleCop.Analyzers:
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/DotNetCli.md
using this ruleset:
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/StyleCop.Analyzers/StyleCop.Analyzers.ruleset
and this settings file:
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/StyleCop.Analyzers/stylecop.json

Expected behavior

SAXXXX warnings appear in the 'Problems' tab of VS Code, and inline in the source files.

Actual behavior

Warnings reported in the 'Problems' tab of VS Code are not changed from the default set (even after restarting OmniSharp), but running dotnet build does display the warnings from StyleCop.Analyzers.

added the Resolved-Duplicate label Aug 15, 2017

commented Aug 15, 2017

Thanks for taking the time to report this issue. We're using #43 to track this work for the future.

closed this Aug 15, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Posts

  • Probably worth posting on the GitHub site for the third party StyleCop addin. Looking at the StyleCop addin I do not think it configures anything to allow running StyleCop when compiling. It adds some menu options so you can run it from Xamarin Studio but does not install anything into Mono the framework.

    Looking at your error message it seems to be missing the StyleCop.dll file. It looks like XBuild found the StyleCop.targets file though which is probably referenced by your project. The StyleCop.dll is included with the StyleCop addin. You can probably change the path in the StyleCop.targets file to point to the StyleCop.dll or if you are OK with putting some files in the Mono directory you could copy it there. The other alternative is to not use StyleCop when compiling but run it manually from the Solution window.

  • On the Xamarin Forms Lab GitHub the project uses the StyleCop.settings file. The path it uses for StyleCop.dll is defined in the StyleCop.settings file. Now the path as it stands will work fine on Windows since the StyleCop installer will add StyleCop.dll to the correct directory. There is no StyleCop installer for Mac. So you will need to make these files available somewhere on your Mac.

  • Sony walkman nwz-b133f drivers for mac. hi @mattward‌ thanks for your feedback, i thought the StyleCop addin added the dll to mono tac or something, guess not.

    will try to a manual copy to see if it works.

  • PTInsider, University, Developer Group Leader✭✭

    I forgot the fact it use a installed dll, my goal was to add stylecop to the build process without install the stylecop..

  • PTInsider, University, Developer Group Leader✭✭

    Liked I said, I missed one step, is requeriment to add the stylecop.dll and then change the targets file for the correct path.
    But I found a easy solution for it, we only need to install this nuget:
    https://www.nuget.org/packages/StyleCop.MSBuild/

    but... after some tests in Windows and in a Mac I found that there is a issue when I build in MAC

    StyleCop.targets: error : Error executing task StyleCopTask: parserType
    Parameter name: Must not be null

    you can see this
    https://stylecop.codeplex.com/workitem/7274

    and for this reason we can use until it be fixed!

  • PTInsider, University, Developer Group Leader✭✭

    I created this issue in stylecop project
    https://stylecop.codeplex.com/workitem/7659

    you can vote!