Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
62 changes: 62 additions & 0 deletions vcpkg/commands/lint-port.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
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

> [!NOTE]
> This command is experimental and may change or be removed at any time.
Comment thread
autoantwort marked this conversation as resolved.
Outdated

## Synopsis

```console
vcpkg x-update-baseline [options] [--fix] [--increase-version] [--all] [package]
Comment thread
autoantwort marked this conversation as resolved.
Outdated
```

## 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` (auto fix often possible):

The following checks are performed:
- `vcpkg_build_msbuild` -> `vcpkg_install_msbuild` (auto fix not avaiable)
- `vcpkg_configure_cmake` -> `vcpkg_cmake_configure` (auto fix avaiable)
- `vcpkg_build_cmake` -> `vcpkg_cmake_build` (auto fix avaiable)
- `vcpkg_install_cmake` -> `vcpkg_cmake_install` (auto fix avaiable)
- `vcpkg_fixup_cmake_targets` -> `vcpkg_fixup_cmake_targets` (auto fix avaiable)
- `vcpkg_extract_source_archive_ex` -> `vcpkg_extract_source_archive` (auto fix avaiable)
- deprecated `vcpkg_check_features` call without `FEATURES` keyword (auto fix avaiable)
Comment thread
autoantwort marked this conversation as resolved.
Outdated


## Options

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

### `--fix`
Comment thread
autoantwort marked this conversation as resolved.

The command tries to fix as many problems as possible.
Comment thread
autoantwort marked this conversation as resolved.
Outdated

### `--increase-version`

- **only when `--fix` is passed**

Increases the `port-version` of ports which where fixed.
Comment thread
autoantwort marked this conversation as resolved.
Outdated

### `--all`

Instead of linting the given ports lint all avaiable ports.
Comment thread
autoantwort marked this conversation as resolved.
Outdated