Skip to content

Commit

Permalink
Use prettier to format project's CSS
Browse files Browse the repository at this point in the history
Part of #88

Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
  • Loading branch information
AObuchow committed Jun 29, 2020
1 parent acaaeab commit c6884b2
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/git-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# Prettify all selected files
./node_modules/.bin/prettier --write .

# Add back the modified/prettified files to staging
git add .

exit 0
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/.metadata/
# Node
/node_modules/
package
# Maven
/target/
/com.aobuchow.themes.spectrum/target/
Expand All @@ -7,5 +9,6 @@
/bin/
# Eclipse Core
/.settings/
/.metadata/
# JDT-specific (Eclipse Java Development Tools)
.classpath
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/node_modules/
README.MD
.github/workflows/
com.aobuchow.themes.spectrum/bin/
package.json
package-lock.json
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"semi": false,
"singleQuote": true,
"overrides": [
{
"files": "com.aobuchow.themes.spectrum/css/preference_styles.css",
"options": {
"printWidth": 50
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${project_loc}/../node_modules/prettier/bin-prettier.js"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="auto,"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="--write . --ignore-path ./../.prettierignore"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/com.aobuchow.themes.spectrum}"/>
</launchConfiguration>
10 changes: 10 additions & 0 deletions com.aobuchow.themes.spectrum/.project
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/Prettier-Format.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "eclipse-spectrum-theme-dev",
"version": "1.0.0",
"description": "Development utilities for Eclipse Spectrum Theme",
"main": "index.js",
"scripts": {
"format": "./node_modules/prettier/bin-prettier.js --write ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/AObuchow/Eclipse-Spectrum-Theme.git"
},
"author": "AObuchow",
"license": "SEE LICENSE IN https://github.com/AObuchow/Eclipse-Spectrum-Theme/blob/master/LICENSE",
"bugs": {
"url": "https://github.com/AObuchow/Eclipse-Spectrum-Theme/issues"
},
"homepage": "https://github.com/AObuchow/Eclipse-Spectrum-Theme#readme",
"devDependencies": {
"prettier": "2.0.5"
}
}

0 comments on commit c6884b2

Please sign in to comment.