{"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":"console","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/d1087a4b9e03d253a88703f34e0869ee4b805456/crates/ruff/src/args.rs#L740-L776","documentation":"ruff accepts exactly one --config argument pointing at a file per invocation; a second file-path --config is rejected with a tip naming both paths. Multiple inline setting overrides (--config lint.line-length=100) do not count — only FilePath-style arguments trip this error.","triggerScenarios":"Running ruff check --config ruff.toml --config pyproject.toml src/, or a wrapper/extension that injects its own --config while the user also passes one.","commonSituations":"Editor extensions (e.g. a configured ruff.config) layered on top of CLI-driven runs; scripts appending a project config to a command that already has one; migrating configs and passing both old and new.","solutions":["Keep a single config file and merge any extra settings into it.","For deltas, use inline overrides next to the one file: --config ruff.toml --config lint.line-length=100.","If two tools both inject --config, disable one (e.g. clear the editor's ruff.config setting for CLI runs)."],"exampleFix":"# before\nruff check --config ruff.toml --config pyproject.toml src/\n\n# after: one file plus inline overrides\nruff check --config ruff.toml --config lint.line-length=100 src/","handlingStrategy":"validation","validationCode":"def config_files(argv: list[str]) -> list[str]:\n    out = []\n    for i, a in enumerate(argv):\n        if a == '--config' and i + 1 < len(argv):\n            out.append(argv[i + 1])\n        elif a.startswith('--config='):\n            value = a.split('=', 1)[1]\n            if '=' not in value:\n                out.append(value)\n    return out\n\nassert len(config_files(sys.argv)) <= 1, 'only one --config file allowed'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep one config file; express deltas as --config section.key=value overrides.","Check whether your editor extension injects --config before adding your own.","Fail fast in wrappers when more than one file-path --config is detected."],"tags":["cli","configuration","flags","ruff"],"backgroundTag":"duplicate-cli-option","analyzedSha":"d1087a4b9e03d253a88703f34e0869ee4b805456","analyzedAt":"2026-08-20T16:33:49.445Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}