{"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":"console","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/d1087a4b9e03d253a88703f34e0869ee4b805456/crates/ruff/src/args.rs#L727-L763","documentation":"Argument validation in ruff's CLI setup. --isolated tells ruff to ignore all configuration discovery, so also naming a config file with --config <path> is contradictory and rejected with a tip before any checking starts (anyhow::bail, non-zero exit). Only file-path --config values trigger this; inline overrides such as --config lint.select=... remain allowed together with --isolated.","triggerScenarios":"Running ruff check --isolated --config ruff.toml src/ (same combination for ruff format or other subcommands), or a script/editor that concatenates both flags from different sources.","commonSituations":"CI pipelines assembling flags from multiple env vars; editor integrations injecting --config while the command line already has --isolated; aliases that bundle --isolated with a shared config.","solutions":["Remove --isolated if you want the named config file to apply.","Remove --config <file> if you want pristine default settings.","For 'mostly isolated with a few tweaks', use --isolated plus inline overrides: --isolated --config lint.select=E501."],"exampleFix":"# before\nruff check --isolated --config ruff.toml src/\n\n# after: choose one\nruff check --isolated src/\nruff check --config ruff.toml src/","handlingStrategy":"validation","validationCode":"def ruff_argv_ok(argv: list[str]) -> bool:\n    if '--isolated' not in argv:\n        return True\n    for i, a in enumerate(argv):\n        value = None\n        if a == '--config' and i + 1 < len(argv):\n            value = argv[i + 1]\n        elif a.startswith('--config='):\n            value = a.split('=', 1)[1]\n        if value is not None and '=' not in value:  # a file path, not an override\n            return False\n    return True","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --isolated as mutually exclusive with file-path --config values.","Use inline overrides (--config lint.select=E501) for isolated runs that need tweaks.","Validate assembled ruff command lines in wrappers/CI before execution."],"tags":["cli","configuration","flags","ruff"],"backgroundTag":"conflicting-cli-flags","analyzedSha":"d1087a4b9e03d253a88703f34e0869ee4b805456","analyzedAt":"2026-08-20T16:33:49.445Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}