{"id":17353298,"url":"https://github.com/igorbek/codecontracts.msbuild","last_synced_at":"2025-04-14T20:52:52.122Z","repository":{"id":19014090,"uuid":"22237032","full_name":"Igorbek/CodeContracts.MSBuild","owner":"Igorbek","description":"Standalone MSBuild integration of CodeContracts (by Microsoft Research)","archived":false,"fork":false,"pushed_at":"2019-09-11T04:12:56.000Z","size":26433,"stargazers_count":17,"open_issues_count":3,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T23:07:39.783Z","etag":null,"topics":["codecontracts","contracts-programming","dotnet","microsoft","msbuild"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Igorbek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-24T23:42:18.000Z","updated_at":"2023-04-20T06:43:16.000Z","dependencies_parsed_at":"2022-08-21T00:10:46.048Z","dependency_job_id":null,"html_url":"https://github.com/Igorbek/CodeContracts.MSBuild","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Igorbek%2FCodeContracts.MSBuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Igorbek%2FCodeContracts.MSBuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Igorbek%2FCodeContracts.MSBuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Igorbek%2FCodeContracts.MSBuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Igorbek","download_url":"https://codeload.github.com/Igorbek/CodeContracts.MSBuild/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961024,"owners_count":21189990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codecontracts","contracts-programming","dotnet","microsoft","msbuild"],"created_at":"2024-10-15T17:16:18.956Z","updated_at":"2025-04-14T20:52:52.099Z","avatar_url":"https://github.com/Igorbek.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"CodeContracts.MSBuild\n=====================\n\nStandalone MSBuild integration for [Microsoft CodeContracts](https://github.com/microsoft/codecontracts) (by Microsoft Research).\n\n## Installation\n\nSimply add `CodeContracts.MSBuild` nuget to projects that use Code Contracts.\n\nFrom package manager:\n\n```\nInstall-Package CodeContracts.MSBuild\n```\n\nFrom .Net CLI:\n\n```\ndotnet add package CodeContracts.MSBuild\n```\n\n## Settings\n\n### `DontOverrideCodeContractsInstallDir`, `CodeContractsInstallDir`\n\nBy default `CodeContracts.MSBuild` uses CodeContracts version that is bundled with this package.\n\nHowever, if you want to use custom CodeContracts installation,\nyou can define the following MSBuild properties in your project file:\n\n```xml\n\u003cPropertyGroup\u003e\n  \u003cDontOverrideCodeContractsInstallDir\u003etrue\u003cDontOverrideCodeContractsInstallDir\u003e\n  \u003cCodeContractsInstallDir\u003eyour_custom_codecontracts_install_dir\\\u003c/CodeContractsInstallDir\u003e\n\u003c/PropertyGroup\u003e\n```\n\n### `CodeContracts*`\n\n`CodeContracts.MSBuild` defines a bunch of default properties that are used by Microsoft CodeContracts.\nPlease refer to CodeContracts for meaning of these options.\n\n| Property | Default value | Description |\n|----------|---------------|-------------|\n| **Runtime checking** |\n| `CodeContractsEnableRuntimeChecking` | `False` | Runtime checking. If `False`, whole section is irrelevant. |\n| `CodeContractsAssemblyMode` | `1` | Assembly mode, `1` = standard, `2` = advanced. |\n| `CodeContractsRuntimeCheckingLevel` | `Full` | Level: `Full`, `Pre and Post`, `Preconditions`, `ReleaseRequires`, `None` |\n| `CodeContractsRuntimeOnlyPublicSurface` | `False` | Only public surface contracts |\n| `CodeContractsRuntimeThrowOnFailure` | `False` | Assert on contract failure |\n| `CodeContractsRuntimeCallSiteRequires` | `False` | Call-site requires checking | `CodeContractsRuntimeSkipQuantifiers` | `False` | Skip quantifiers |\n| `CodeContractsCustomRewriterAssembly` | *empty* | Custom rewriter methods / Assembly |\n| `CodeContractsCustomRewriterClass` | *empty* | Custom rewriter methods / Class |\n| **Static checking** |\n| `CodeContractsRunCodeAnalysis` | `True` | Static checking. If `False`, whole section is irrelevant. |\n| `CodeContractsNonNullObligations` | `True` | Check non-null |\n| `CodeContractsEnumObligations` | `True` | Check enum values |\n| `CodeContractsRedundantAssumptions` | `True` | Check redundant assume |\n| `CodeContractsSuggestAssumptions` | `False` | Show entry assumptions |\n| `CodeContractsSuggestRequires` | `False` | Suggest requires |\n| `CodeContractsAssertsToContractsCheckBox` | `True` | Suggest asserts to contracts |\n| `CodeContractsInferRequires` | `True` | Infer requires |\n| `CodeContractsInferEnsures` | `False` | Infer ensures |\n| `CodeContractsArithmeticObligations` | `True` | Check arithmetic |\n| `CodeContractsMissingPublicRequiresAsWarnings` | `True` | Check missing public requires |\n| `CodeContractsRedundantTests` | `True` | Check redundant conditionals |\n| `CodeContractsSuggestAssumptionsForCallees` | `False`| Show external assumptions |\n| `CodeContractsSuggestReadonly` | `True`| Suggest readonly fields |\n| `CodeContractsNecessaryEnsures` | `True` | Suggest necessary ensures |\n| `CodeContractsInferObjectInvariants` | `False` | Infer invariants for readonly |\n| `CodeContractsInferEnsuresAutoProperties` | `True` | Infer ensures for autoproperties |\n| `CodeContractsFailBuildOnWarnings` | `False` | Fail build on warnings |\n| `CodeContractsBoundsObligations` | `True` | Check array bounds |\n| `CodeContractsMissingPublicEnsuresAsWarnings` | `False` | Check missing public ensures |\n| `CodeContractsSuggestObjectInvariants` | `False` | Suggest object invariants |\n| **Misc**\n| `CodeContractsCacheAnalysisResults` | `True` | Cache results |\n| `CodeContractsSQLServerOption` | *empty* | SQL Server |\n| `CodeContractsSkipAnalysisIfCannotConnectToCache` | `False` | Skip the analysis if cannot connect to cache |\n| `CodeContractsAnalysisWarningLevel` | `0` | Warning level: `0`, `1`, `2`, `3` |\n| `CodeContractsBeingOptimisticOnExternal` | `True` | Be optimistic on external API |\n| `CodeContractsUseBaseLine` | `False` | Baseline |\n| `CodeContractsBaseLineFile`| *empty* | Baseline file |\n| `CodeContractsReferenceAssembly` | `Build` | Contract reference assembly |\n| `CodeContractsEmitXMLDocs` | `False` | Emit contracts into XML doc file |\n| **Advanced options** |\n| `CodeContractsLibPaths` | *empty* | Extra contract library paths |\n| `CodeContractsExtraRewriteOptions` | *empty* | Extra runtime checker options |\n| `CodeContractsExtraAnalysisOptions` | *empty* | Extra static checker options |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorbek%2Fcodecontracts.msbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorbek%2Fcodecontracts.msbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorbek%2Fcodecontracts.msbuild/lists"}