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

Develop/fxcop #2174

Merged
merged 17 commits into from
Nov 6, 2018
Merged

Develop/fxcop #2174

merged 17 commits into from
Nov 6, 2018

Conversation

SteveGilham
Copy link
Contributor

Description

Ported FXCopHelper.fs to FAKE 5 as Fake.Tools.FxCop

TODO

I believe these all to be done, assuming that API-docs are the triple-/ comments I see elsewhere in the code base --

  • [] New (API-)documentation for new features exist (Note: API-docs are enough, additional docs are in help/markdown)
  • [] unit or integration test exists (or short reasoning why it doesn't make sense)
  • [] boy scout rule: "leave the code behind in a better state than you found it" (fix warnings, obsolete members or code-style in the places you worked in)
  • [] (if new module) the module has been linked from the "Modules" menu, edit help/templates/template.cshtml, linking to the API-reference is fine.
  • [] (if new module) the module is in the correct namespace
  • [] (if new module) the module is added to Fake.sln (dotnet sln Fake.sln add src/app/Fake.*/Fake.*.fsproj)
  • [] Fake 5 API guideline is honored

let serializingObject = Object()

let testCases =
if Environment.isWindows then
Copy link
Member

Choose a reason for hiding this comment

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

Thanks a lot for the tests! I guess this is because fxcop doesn't run on non-windows platforms at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my intention, yes.

@matthid
Copy link
Member

matthid commented Oct 29, 2018

@kblohm Should we categorize the module somewhere else (Fake.Windows?)

@kblohm
Copy link
Contributor

kblohm commented Oct 29, 2018

If you expect more analysers, maybe Fake.Analyzers? But i think DotNet is fine. 👍 I personally would not search for something like FxCop under Fake.Windows just because it is not crossplatform.

Is it possible to use BlackFox.Vswhere to detect the location? That way it would be consistent with the MsBuild-Module.
I would also squash the PR ;).

Copy link
Member

@matthid matthid left a comment

Choose a reason for hiding this comment

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

Very close to being merged 👍

<ProjectReference Include="..\Fake.IO.FileSystem\Fake.IO.FileSystem.fsproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="blackfox.vswhere" Version="0.3.2" />
Copy link
Member

Choose a reason for hiding this comment

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

This should go to paket.references

@@ -0,0 +1,212 @@
[<RequireQualifiedAccess>]
module Fake.DotNet.FxCop
Copy link
Member

Choose a reason for hiding this comment

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

(optional) I often get the feedback that actual samples help a lot so adding one to the docs here would be nice. Just a simple example like the following is enough:

https://github.com/fsharp/FAKE/blob/3827f95ad533978ec14c29db92658f48b0609e05/src/app/Fake.Api.GitHub/GitHub.fs#L11-L32


/// This checks the result file with some XML queries for errors
/// [omit]
let checkForErrors resultFile =
Copy link
Member

Choose a reason for hiding this comment

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

I guess this is public by design?

Copy link
Member

Choose a reason for hiding this comment

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

If yes, why omit it from the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That one is just copied verbatim from the legacy implementation, so the design question should really be addressed to the original author.

The function would extract results from FxCop output derived from other sources, so is useful to that extent, but I'm not invested one way or the other.

Expect.isTrue (p.IncludeSummaryReport)
"A field should have non-default value for a bool"
Expect.equal args [ "/c"
"/f:\"" + dummy + "\""
Copy link
Member

Choose a reason for hiding this comment

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

by the way, have you actually run the code? I feel like this quote might be quoted again later and therefore not work as expected.

@SteveGilham
Copy link
Contributor Author

This started out as something to #load into my own build scripts, including ensuring that it would break the build as required, so yes, I have run (am running with) this code.

@matthid matthid merged commit 4eadc22 into fsprojects:release/next Nov 6, 2018
@matthid
Copy link
Member

matthid commented Nov 6, 2018

Thanks for helping out with this!

@SteveGilham SteveGilham deleted the develop/fxcop branch November 15, 2018 17:27
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.

3 participants