mirror of https://github.com/astral-sh/ruff
Use trailingComma: 'all' (#1457)
This commit is contained in:
parent
2c7464604a
commit
9db825c731
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"trailingComma": "all"
|
||||||
|
}
|
||||||
|
|
@ -18,7 +18,7 @@ export function ErrorMessage({ children }: { children: string }) {
|
||||||
children.startsWith("Error: ")
|
children.startsWith("Error: ")
|
||||||
? children.slice("Error: ".length)
|
? children.slice("Error: ".length)
|
||||||
: children,
|
: children,
|
||||||
120
|
120,
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export default function Header({
|
||||||
"border-gray-200",
|
"border-gray-200",
|
||||||
"dark:border-gray-800",
|
"dark:border-gray-800",
|
||||||
"bg-ayu-background",
|
"bg-ayu-background",
|
||||||
"dark:bg-ayu-background-dark"
|
"dark:bg-ayu-background-dark",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="flex space-x-5">
|
<div className="flex space-x-5">
|
||||||
|
|
@ -55,14 +55,14 @@ export default function Header({
|
||||||
"relative flex py-3 text-sm leading-6 font-semibold focus:outline-none",
|
"relative flex py-3 text-sm leading-6 font-semibold focus:outline-none",
|
||||||
tab === "Source"
|
tab === "Source"
|
||||||
? "text-ayu-accent"
|
? "text-ayu-accent"
|
||||||
: "text-gray-700 hover:text-gray-900 focus:text-gray-900 dark:text-gray-300 dark:hover:text-white"
|
: "text-gray-700 hover:text-gray-900 focus:text-gray-900 dark:text-gray-300 dark:hover:text-white",
|
||||||
)}
|
)}
|
||||||
onClick={() => onChangeTab("Source")}
|
onClick={() => onChangeTab("Source")}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"absolute bottom-0 inset-x-0 bg-ayu-accent h-0.5 rounded-full transition-opacity duration-150",
|
"absolute bottom-0 inset-x-0 bg-ayu-accent h-0.5 rounded-full transition-opacity duration-150",
|
||||||
tab === "Source" ? "opacity-100" : "opacity-0"
|
tab === "Source" ? "opacity-100" : "opacity-0",
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
Source
|
Source
|
||||||
|
|
@ -73,14 +73,14 @@ export default function Header({
|
||||||
"relative flex py-3 text-sm leading-6 font-semibold focus:outline-none",
|
"relative flex py-3 text-sm leading-6 font-semibold focus:outline-none",
|
||||||
tab === "Settings"
|
tab === "Settings"
|
||||||
? "text-ayu-accent"
|
? "text-ayu-accent"
|
||||||
: "text-gray-700 hover:text-gray-900 focus:text-gray-900 dark:text-gray-300 dark:hover:text-white"
|
: "text-gray-700 hover:text-gray-900 focus:text-gray-900 dark:text-gray-300 dark:hover:text-white",
|
||||||
)}
|
)}
|
||||||
onClick={() => onChangeTab("Settings")}
|
onClick={() => onChangeTab("Settings")}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"absolute bottom-0 inset-x-0 bg-ayu-accent h-0.5 rounded-full transition-opacity duration-150",
|
"absolute bottom-0 inset-x-0 bg-ayu-accent h-0.5 rounded-full transition-opacity duration-150",
|
||||||
tab === "Settings" ? "opacity-100" : "opacity-0"
|
tab === "Settings" ? "opacity-100" : "opacity-0",
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
Settings
|
Settings
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export default function SettingsEditor({
|
||||||
(value: string | undefined) => {
|
(value: string | undefined) => {
|
||||||
onChange(value ?? "");
|
onChange(value ?? "");
|
||||||
},
|
},
|
||||||
[onChange]
|
[onChange],
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<Editor
|
<Editor
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ export default function SourceEditor({
|
||||||
check.code === "F401" || check.code === "F841"
|
check.code === "F401" || check.code === "F841"
|
||||||
? [MarkerTag.Unnecessary]
|
? [MarkerTag.Unnecessary]
|
||||||
: [],
|
: [],
|
||||||
}))
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
const codeActionProvider = monaco?.languages.registerCodeActionProvider(
|
const codeActionProvider = monaco?.languages.registerCodeActionProvider(
|
||||||
|
|
@ -81,7 +81,7 @@ export default function SourceEditor({
|
||||||
}));
|
}));
|
||||||
return { actions, dispose: () => {} };
|
return { actions, dispose: () => {} };
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
@ -93,7 +93,7 @@ export default function SourceEditor({
|
||||||
(value: string | undefined) => {
|
(value: string | undefined) => {
|
||||||
onChange(value ?? "");
|
onChange(value ?? "");
|
||||||
},
|
},
|
||||||
[onChange]
|
[onChange],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export default function VersionTag({ children }: { children: ReactNode }) {
|
||||||
"items-center",
|
"items-center",
|
||||||
"dark:bg-gray-800",
|
"dark:bg-gray-800",
|
||||||
"dark:text-gray-400",
|
"dark:text-gray-400",
|
||||||
"dark:shadow-highlight/4"
|
"dark:shadow-highlight/4",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export function stringify(settings: Settings): string {
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
2
|
2,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ export function stringify(settings: Settings): string {
|
||||||
*/
|
*/
|
||||||
export function persist(settingsSource: string, pythonSource: string) {
|
export function persist(settingsSource: string, pythonSource: string) {
|
||||||
window.location.hash = lzstring.compressToEncodedURIComponent(
|
window.location.hash = lzstring.compressToEncodedURIComponent(
|
||||||
settingsSource + "$$$" + pythonSource
|
settingsSource + "$$$" + pythonSource,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@ export function persist(settingsSource: string, pythonSource: string) {
|
||||||
*/
|
*/
|
||||||
export function restore(): [string, string] | null {
|
export function restore(): [string, string] | null {
|
||||||
const value = lzstring.decompressFromEncodedURIComponent(
|
const value = lzstring.decompressFromEncodedURIComponent(
|
||||||
window.location.hash.slice(1)
|
window.location.hash.slice(1),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,5 @@ import "./index.css";
|
||||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<Editor />
|
<Editor />
|
||||||
</React.StrictMode>
|
</React.StrictMode>,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
declare module "lz-string" {
|
declare module "lz-string" {
|
||||||
function decompressFromEncodedURIComponent(
|
function decompressFromEncodedURIComponent(
|
||||||
input: string | null
|
input: string | null,
|
||||||
): string | null;
|
): string | null;
|
||||||
function compressToEncodedURIComponent(input: string | null): string;
|
function compressToEncodedURIComponent(input: string | null): string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue