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

Add docs for x-lint-port #23

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions vcpkg/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@
href: commands/search.md
- name: vcpkg x-update-baseline
href: commands/update-baseline.md
- name: vcpkg x-lint-port
href: commands/lint-port.md
- name: vcpkg version
href: commands/version.md
- name: Contributing to vcpkg
Expand Down
67 changes: 67 additions & 0 deletions vcpkg/commands/lint-port.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: vcpkg x-lint-port
description: Command line reference for the vcpkg x-lint-port command. Searches and fixes common port bugs.
ms.date: 01/05/2023
---
# vcpkg x-lint-port

[!INCLUDE [experimental](../../includes/experimental.md)]

## Synopsis

```console
vcpkg x-update-baseline [options] [--fix] [--increase-version] [--all | port...]
```

## Description

Lints a port and fixes found problems if `--fix` was passed.

It performs the following checks:
- Check used version scheme (auto fix possible):

If `version-string` is used check if `version` or `version-date` would also be possible and suggest that

- Check for license expression (auto fix not possible):

Emits an warning if the port does not have a license expression

- Check for deprecated license expressions (auto fix often possible):

Warns when a deprecated license expressions is used and suggests a non deprecated one.

- Check for the use of deprecated functions in `portfile.cmake`:

- `vcpkg_build_msbuild` -> `vcpkg_install_msbuild` (auto fix not available)
- `vcpkg_configure_cmake` -> `vcpkg_cmake_configure` (auto fix available)
- `vcpkg_build_cmake` -> `vcpkg_cmake_build` (auto fix available)
- `vcpkg_install_cmake` -> `vcpkg_cmake_install` (auto fix available)
- `vcpkg_fixup_cmake_targets` -> `vcpkg_fixup_cmake_targets` (auto fix available)
- `vcpkg_extract_source_archive_ex` -> `vcpkg_extract_source_archive` (auto fix available)

- `vcpkg_check_features` call without `FEATURES` keyword (auto fix available)


## Options

All vcpkg commands support a set of [common options](common-options.md).

### `port...`

The list of ports to lint and fix.

Required if `--all` was not passed.

### `--fix`
autoantwort marked this conversation as resolved.
Show resolved Hide resolved

Apply all automatic fixes to the port files.

### `--increase-version`

Increases the `port-version` of ports which where fixed.

Requires `--fix` to also be passed.

### `--all`

Instead of linting the given ports lint all available ports.