{"record":{"id":"0123fc0cccb906d8","repo":"astral-sh/ruff","slug":"you-cannot-specify-more-than-one-configuration-fil","errorCode":null,"errorMessage":"You cannot specify more than one configuration file on the command line.\n\n  tip: remove either `--config={first}` or `--config={second}`.\n       For more information, try `--help`.\n","messagePattern":"You cannot specify more than one configuration file on the command line\\.\n\n  tip: remove either `--config=(.+?)` or `--config=(.+?)`\\.\n       For more information, try `--help`\\.\n","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff/src/args.rs","lineNumber":758,"sourceCode":"                        &path_dedot::CWD,\n                    )?);\n                }\n                SingleConfigArgument::FilePath(path) => {\n                    if isolated {\n                        bail!(\n                            \"\\\nThe argument `--config={}` cannot be used with `--isolated`\n\n  tip: You cannot specify a configuration file and also specify `--isolated`,\n       as `--isolated` causes ruff to ignore all configuration files.\n       For more information, try `--help`.\n\",\n                            path.display()\n                        );\n                    }\n                    if let Some(ref config_file) = config_file {\n                        let (first, second) = (config_file.display(), path.display());\n                        bail!(\n                            \"\\\nYou cannot specify more than one configuration file on the command line.\n\n  tip: remove either `--config={first}` or `--config={second}`.\n       For more information, try `--help`.\n\"\n                        );\n                    }\n                    config_file = Some(path);\n                }\n            }\n        }\n        Ok(Self {\n            isolated,\n            log_level,\n            config_file,\n            overrides,\n            per_flag_overrides,","sourceCodeStart":740,"sourceCodeEnd":776,"githubUrl":"https://github.com/astral-sh/ruff/blob/15f3fe6b15a5f00172f34b0f542f8ea277f5a586/crates/ruff/src/args.rs#L740-L776","documentation":"Ruff's CLI accepts at most one configuration file via `--config`. When a second `--config` argument is supplied, argument parsing bails with this error naming both conflicting paths, since it cannot decide which configuration to use.","triggerScenarios":"Running ruff with two `--config` flags on one command line, e.g. `ruff check --config=a/ruff.toml --config=b/ruff.toml`, triggering the duplicate-config check in args parsing.","commonSituations":"Wrapper scripts or CI matrices appending their own `--config` while the base command already has one; copy-pasted commands merging two projects' configs; editor integrations concatenating config arguments.","solutions":["Remove one of the two `--config` flags, keeping the configuration you intend to apply.","Merge the two TOML files into a single config if both sets of settings are needed.","Fix wrapper scripts so they override, not append, any existing `--config` argument."],"exampleFix":"// before\nruff check --config=a/ruff.toml --config=b/ruff.toml src/\n// after\nruff check --config=b/ruff.toml src/","handlingStrategy":"validation","validationCode":"# Ensure at most one --config before invoking ruff:\nconfigs = [a for a in sys.argv[1:] if a.startswith('--config=')]\nif len(configs) > 1:\n    raise SystemExit(f'multiple --config flags: {configs}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Have wrapper scripts override rather than append --config.","Merge multiple TOML configs into one instead of stacking flags.","Check CI matrices for duplicated config arguments from different layers."],"tags":["cli","configuration","flags","ruff"],"backgroundTag":"conflicting-cli-flags","analyzedSha":"15f3fe6b15a5f00172f34b0f542f8ea277f5a586","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}