|
| 1 | +--- |
| 2 | +title: "composer_outdated_flag" |
| 3 | +date: 2025-11-23T10:00:00+01:00 |
| 4 | +anchor: "composer-outdated-flag" |
| 5 | +weight: |
| 6 | +--- |
| 7 | + |
| 8 | +## Configuration |
| 9 | + |
| 10 | +<div className="config-wrapper"><div className="config">__name__: composer_outdated_flag</div> |
| 11 | +<div className="config">__type__: string</div> |
| 12 | +<div className="config">__default__: minor</div></div> |
| 13 | + |
| 14 | +```json showLineNumbers |
| 15 | +{ |
| 16 | + "name": "company/project", |
| 17 | + "extra": { |
| 18 | + "violinist": { |
| 19 | +// highlight-next-line |
| 20 | + "composer_outdated_flag": "minor" |
| 21 | + } |
| 22 | + } |
| 23 | +} |
| 24 | +``` |
| 25 | + |
| 26 | +Control the semantic versioning level for checking outdated packages. |
| 27 | + |
| 28 | +## Explanation |
| 29 | + |
| 30 | +By default, Violinist uses the `composer outdated -D -m` command to check for updates, where the `-m` flag restricts checks to minor SemVer-compatible updates. The `composer_outdated_flag` option allows you to customize this behavior by specifying which level of updates you want to check for. |
| 31 | + |
| 32 | +The option accepts three values: |
| 33 | + |
| 34 | +- **`major`**: Check for all updates including major version changes (no restriction flag) |
| 35 | +- **`minor`**: Check only for minor and patch updates (uses `-m` / `--minor-only` flag) - this is the default |
| 36 | +- **`patch`**: Check only for patch-level updates (uses `-p` / `--patch-only` flag) |
| 37 | + |
| 38 | +This setting affects how Violinist searches for available updates, which in turn determines what pull requests will be created for your project. |
| 39 | + |
| 40 | +## Example |
| 41 | + |
| 42 | +If you want to be more conservative and only receive pull requests for patch-level updates (bug fixes and security patches), you can configure your project like this: |
| 43 | + |
| 44 | +```json showLineNumbers |
| 45 | +{ |
| 46 | + "name": "company/project", |
| 47 | + "description": "My production application", |
| 48 | + "require": { |
| 49 | + "vendor/package": "^2.1.0", |
| 50 | + }, |
| 51 | + "extra": { |
| 52 | + "violinist": { |
| 53 | +// highlight-next-line |
| 54 | + "composer_outdated_flag": "patch" |
| 55 | + } |
| 56 | + } |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +With this configuration, if you have version 2.1.0 installed and versions 2.1.1, 2.2.0, and 3.0.0 are available, Violinist will only create a pull request for version 2.1.1. |
| 61 | + |
| 62 | +Conversely, if you want to receive pull requests for all updates including major version changes: |
| 63 | + |
| 64 | +```json showLineNumbers |
| 65 | +{ |
| 66 | + "name": "company/project", |
| 67 | + "description": "My development project", |
| 68 | + "require": { |
| 69 | + "vendor/package": "^2.1.0", |
| 70 | + }, |
| 71 | + "extra": { |
| 72 | + "violinist": { |
| 73 | +// highlight-next-line |
| 74 | + "composer_outdated_flag": "major" |
| 75 | + } |
| 76 | + } |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | +With this configuration, Violinist will create pull requests for major version updates like 3.0.0, in addition to minor and patch updates. |
| 81 | + |
| 82 | +> Note: This option can be combined with other configuration options like [check_only_direct_dependencies](/configuration/check_only_direct_dependencies), [security_updates_only](/configuration/security_updates_only), and others to fine-tune which updates you want to receive. |
0 commit comments