Skip to content

(GH-579) Add dsc lint as a plug-in command - #1809

Draft
Gijs Reijn (Gijsreyn) wants to merge 9 commits into
PowerShell:mainfrom
Gijsreyn:gh-461/main/prototype-dsc-lint
Draft

Gijs Reijn (Gijsreyn) wants to merge 9 commits into
PowerShell:mainfrom
Gijsreyn:gh-461/main/prototype-dsc-lint

Conversation

@Gijsreyn

Copy link
Copy Markdown
Collaborator

PR Summary

This change:

PR Context

The earlier PR #1768 adds dsclint as a separate executable. The working group preferred to reach it as dsc lint through a plug-in system instead of a built-in subcommand. This PR shows the two together: no linter code is compiled into the dsc command, and dsc lint returns the same output and exit code as dsclint.

This branch contains the commits of #1808. Until that PR merges, the diff here includes it. Review only the merge commit and what follows.

Remarks on the design

  • Port, not rewrite. The lint code is the code from (GH-579) Add dsclint executable #1768. Changes are limited to what main moved since: the settings API, the ResourceCapability rename, and resource lookup returning a trait object.
  • Lint settings. lint.rules is now a field of the settings files (machine, user, workspace and policy) and is merged in that order, with policy applied last.
  • Invalid lint section. It now makes that settings file fail to load with a warning, like any other invalid field. (GH-579) Add dsclint executable #1768 reported a dedicated lint settings error.
  • Tracing. dsc --trace-level info lint ... applies to the linter. An option after lint overrides it.
  • Version. dsclint and its manifest are at 3.4.0-preview.3 to match dsc.
  • Schema errors. Resource input and output validation reports all schema errors with their location in the document, as in (GH-579) Add dsclint executable #1768.

Known gaps

  • dsc help lint prints Usage: dsclint.exe.
  • The lint settings field has no schema documentation strings yet.
  • The manifest is in the build's file lists, but the MSIX, RPM and DEB packaging isn't verified.

…in/add-dsc-lint-command

# Conflicts:
#	dsc/src/subcommand.rs
#	xtask/src/schemas/export.rs
…fest

Ports the lint settings and `dsclint` tracing to the settings module, adds the `Microsoft.DSC/Lint` plug-in manifest so `dsc lint` runs `dsclint`, and adds Pester tests for the plug-in command.
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.

1 participant