{"record":{"id":"c38914474a4ee62b","repo":"astral-sh/ruff","slug":"the-argument-config-cannot-be-used-with","errorCode":null,"errorMessage":"The 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","messagePattern":"The 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","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff/src/args.rs","lineNumber":745,"sourceCode":"    ) -> anyhow::Result<Self> {\n        let (log_level, config_options, isolated) = global_options.partition();\n        let mut config_file: Option<PathBuf> = None;\n        let mut overrides = Configuration::default();\n\n        for option in config_options {\n            match option {\n                SingleConfigArgument::SettingsOverride(overridden_option) => {\n                    let overridden_option = Arc::try_unwrap(overridden_option)\n                        .unwrap_or_else(|option| option.deref().clone());\n                    overrides = overrides.combine(Configuration::from_options(\n                        overridden_option,\n                        None,\n                        &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`.","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/astral-sh/ruff/blob/15f3fe6b15a5f00172f34b0f542f8ea277f5a586/crates/ruff/src/args.rs#L727-L763","documentation":"Ruff's CLI rejects combining `--isolated` (which makes ruff ignore all configuration files) with an explicit `--config=<path>`. The two options are contradictory, so argument parsing bails with this error pointing at both flags and suggesting `--help`.","triggerScenarios":"Invoking ruff with both `--isolated` and `--config=path/to/pyproject.toml|ruff.toml` (or a resolved config file argument) on the same command line.","commonSituations":"Shell aliases or wrapper scripts that always add `--isolated` while users append a config path; CI scripts combining flags from different sources; editor integrations injecting `--config` into commands already using `--isolated`.","solutions":["Remove `--config=...` if you truly want isolated, default-settings behavior.","Remove `--isolated` when you need the settings from the specified config file.","Move the shared settings into the config file and drop `--isolated` from wrapper scripts/aliases."],"exampleFix":"// before\nruff check --isolated --config=ruff.toml src/\n// after\nruff check --config=ruff.toml src/","handlingStrategy":"validation","validationCode":"# Reject the conflicting combination before invoking ruff:\nflags = sys.argv[1:]\nif '--isolated' in flags and any(f.startswith('--config=') or f == '--config' for f in flags):\n    raise SystemExit('--config cannot be used with --isolated')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Decide up front: either isolated mode or an explicit config file, never both.","Audit wrapper scripts/aliases that hardcode --isolated.","Keep project settings in a config file instead of relying on --isolated plus flags."],"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"}