Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,14 @@ jobs:

- name: Run linters
run: |
npx prettier --check .
sed '/^[[:blank:]]*[\\.\\}\\@]/d;/^[[:blank:]]*\..*/d;/^[[:blank:]]*$/d;/\/\/.*/d' ui/lib/src/main/resources/lucuma-css/lucuma-ui-variables-dark.scss >vars.css
find ui/lib/src/main/resources/lucuma-css -maxdepth 1 -type f -exec sed -n -e '/^[[:space:]]*--.*;[[:space:]]*$/p' -e '/^[[:space:]]*--[^;]*$/,/;$/p' {} + >vars.css
npx stylelint --formatter github explore/common/src/main/webapp/sass
npx stylelint --formatter github observe/web/client/src/main/webapp/styles
npx stylelint --formatter github ui/lib/src/main/resources/lucuma-css
rm vars.css
sed '/^[[:blank:]]*[\\.\\}\\@]/d;/^[[:blank:]]*\..*/d;/^[[:blank:]]*$/d;/\/\/.*/d' ui/lib/src/main/resources/lucuma-css/lucuma-ui-variables-light.scss >vars.css
find ui/lib/src/main/resources/lucuma-css -maxdepth 1 -type f -exec sed -n -e '/^[[:space:]]*--.*;[[:space:]]*$/p' -e '/^[[:space:]]*--[^;]*$/,/;$/p' {} + >vars.css
npx stylelint --formatter github explore/common/src/main/webapp/sass
npx stylelint --formatter github observe/web/client/src/main/webapp/styles
npx stylelint --formatter github ui/lib/src/main/resources/lucuma-css
rm vars.css
npx prettier --check .
2 changes: 1 addition & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
**/datepicker/*.scss
**/vars.css
**/lucuma-css/**
*.svg
27 changes: 14 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -946,27 +946,28 @@ def prettierCmd(fix: Boolean): String =

def styleLintCmds(mode: String, fix: Boolean, dirs: List[String]): List[String] = {
val stylelintFixFlag = if (fix) " --fix" else ""
// Removes all lines that don't define a variable, thus building a viable CSS file for linting
(raw"""sed '/^[[:blank:]]*[\\.\\}\\@]/d;/^[[:blank:]]*\..*/d;/^[[:blank:]]*$$/d;/\/\/.*/d' ui/lib/src/main/resources/lucuma-css/lucuma-ui-variables-$mode.scss >vars.css"""
// Removes all lines that don't define a variable, thus building a viable CSS file for linting. Thanks ChatGPT.
(raw"""find ui/lib/src/main/resources/lucuma-css -maxdepth 1 -type f -exec sed -n -e '/^[[:space:]]*--.*;[[:space:]]*$$/p' -e '/^[[:space:]]*--[^;]*$$/,/;$$/p' {} + >vars.css"""
+: dirs.map(dir => s"npx stylelint --formatter github $stylelintFixFlag $dir")) :+
"rm vars.css"
}

val cssDirs: List[String] = List(
"explore/common/src/main/webapp/sass"
"explore/common/src/main/webapp/sass",
"observe/web/client/src/main/webapp/styles",
"ui/lib/src/main/resources/lucuma-css"
)

def allStyleLintCmds(fix: Boolean): List[String] =
styleLintCmds("dark", fix, cssDirs) ++
styleLintCmds("light", fix, cssDirs)

def allLintCmds(fix: Boolean): List[String] =
prettierCmd(fix) +: allStyleLintCmds(fix)
allStyleLintCmds(fix) :+ prettierCmd(fix)

def runCmds(cmds: List[String]): Unit = {
val batch: List[ProcessBuilder] = cmds.flatMap { cmd =>
val fixedCmd: String =
cmd.replaceAll("'", "") // We don't need the quotes when running from here.
val fixedCmd: String = cmd.replaceAll("'", "") // Quotes not needed when running from here.
val echo: ProcessBuilder = Process(s"echo <$fixedCmd>")
val split: List[String] = fixedCmd.split(" >").toList
split match {
Expand All @@ -980,16 +981,16 @@ def runCmds(cmds: List[String]): Unit = {
}
}

val lint: TaskKey[Unit] = taskKey[Unit]("Lint style files")
lint := {
val lintCheck: TaskKey[Unit] = taskKey[Unit]("Lint style files")
lintCheck := {
val _ = (ui_css / Compile / lucumaCss).value // Ensure Prime CSS is imported
runCmds(allStyleLintCmds(fix = false))
runCmds(allLintCmds(fix = false))
}

val fix: TaskKey[Unit] = taskKey[Unit]("Fix style files")
fix := {
val lintFix: TaskKey[Unit] = taskKey[Unit]("Fix style files")
lintFix := {
val _ = (ui_css / Compile / lucumaCss).value // Ensure Prime CSS is imported
runCmds(allStyleLintCmds(fix = true))
runCmds(allLintCmds(fix = true))
}

addCommandAlias(
Expand All @@ -1004,7 +1005,7 @@ addCommandAlias(

addCommandAlias(
"fixAll",
"; prePR; fix"
"; prePR; lintFix"
)

// Custom commands to facilitate web development
Expand Down
15 changes: 1 addition & 14 deletions explore/common/src/main/webapp/sass/explore.scss
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,8 @@ thead tr th.sticky-header {
}

.input-replacement-icon {
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
line-height: var(--pl-input-line-height);
border: 1px dashed transparent; // the border makes the sizing work.
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
padding: var(--pl-input-padding);
}

Expand Down Expand Up @@ -1353,9 +1351,7 @@ $search-preview-margin: 5px;
}

.p-datatable-tbody > tr.explore-sequence-row-done {
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
color: var(--disabled-row-color);
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
background: var(--disabled-row-background);
}

Expand Down Expand Up @@ -1474,9 +1470,6 @@ svg.fa-check.explore-success-icon {
background-color: var(--obs-badge-background);
border: solid 1px var(--site-border-color);
border-radius: 3px;

// defined in lucuma-ui.scss. Linting doesn't capture that.
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
font-size: var(--pl-mini-font-size);

.p-component.p-button {
Expand All @@ -1503,7 +1496,6 @@ svg.fa-check.explore-success-icon {
color: var(--obs-badge-color);
display: flex;
justify-content: space-between;
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
font-size: var(--pl-large-font-size);
font-weight: 400;
word-break: break-all;
Expand Down Expand Up @@ -1532,7 +1524,6 @@ svg.fa-check.explore-success-icon {

display: flex;
justify-content: space-between;
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
font-size: var(--pl-tiny-font-size);
}

Expand Down Expand Up @@ -2477,7 +2468,6 @@ input[type='file'].explore-fileupload {
}

label {
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
font-size: var(--pl-tiny-font-size);
}
}
Expand Down Expand Up @@ -2840,7 +2830,6 @@ $help-title-height: 40px;
line-height: 0;

&::after {
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
font-size: var(--pl-tiny-font-size);
line-height: 1.2;
}
Expand Down Expand Up @@ -3323,7 +3312,6 @@ div.spectroscopy-table-emptymessage {

.explore-proposal-deadline {
.p-inline-message-text {
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
font-size: var(--pl-tiny-font-size);
line-height: normal;
}
Expand Down Expand Up @@ -3434,8 +3422,7 @@ div.spectroscopy-table-emptymessage {
}

a.explore-upgrade-link {
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
color: var(--text-secondary-color);
color: var(--text-color-secondary);
text-decoration: underline;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class NavigateEngineSpec extends CatsEffectSuite {

private given Logger[IO] = Slf4jLogger.getLoggerFromName[IO]("navigate-engine")

override def munitFlakyOK: Boolean = true

val guideOnCfg = TelescopeGuideConfig(
mountGuide = MountGuideOption.MountGuideOn,
m1Guide = M1GuideConfig.M1GuideOn(M1Source.OIWFS),
Expand Down
3 changes: 0 additions & 3 deletions observe/web/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@
},
"devDependencies": {
"@vitejs/plugin-react": "5.0.4",
"prettier": "3.6.2",
"process": "0.11.10",
"sass": "1.93.2",
"unplugin-fonts": "1.4.0",
"vite": "7.1.10",
"vite-plugin-mkcert": "1.17.9"
},
"scripts": {
"lint": "npx stylelint web/src/main/webapp/styles",
"fix": "npx stylelint --fix web/src/main/webapp/styles",
"build": "node --unhandled-rejections=strict build.js",
"serve": "vite preview"
},
Expand Down
Loading
Loading