Skip to content

Commit

Permalink
chore: Upgrade to Prettier v3
Browse files Browse the repository at this point in the history
- Update to v3
- Ignore HTML, generated files, and yamllint
- Autofix for change in trailing comma style
- Keep YML/YAML files with double quotes consistently
  • Loading branch information
nschonni committed Jun 9, 2024
1 parent 8b133f3 commit 7da9e90
Show file tree
Hide file tree
Showing 30 changed files with 151 additions and 139 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Dependencies parser

on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
repository_dispatch:
push:
branches:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lint-yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/markdownlint-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "markdownlint",
"pattern": [
{
"owner": "markdownlint",
"pattern": [
{
"regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
"regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
]
}
]
}
1 change: 0 additions & 1 deletion .github/workflows/sync-french.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest
if: github.repository_owner == 'canada-ca'

Expand Down
6 changes: 1 addition & 5 deletions .licensee.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"licenses": {
"spdx": [
"CC-BY-3.0",
"CC0-1.0",
"Unlicense"
],
"spdx": ["CC-BY-3.0", "CC0-1.0", "Unlicense"],
"osi": true
},
"packages": {
Expand Down
6 changes: 3 additions & 3 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"default": true,
"MD013": false,
"MD024": {
"siblings_only": true
"siblings_only": true,
},
"MD025": false,
"MD026": false,
"MD041": false
"MD041": false,
},
"ignores": ["node_modules", "_data/spdx"]
"ignores": ["node_modules", "_data/spdx"],
}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_data/
_data_templates/
_site/
assets/js/lib/
*.html
.yamllint.yaml
10 changes: 9 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"semi": true,
"singleQuote": true
"singleQuote": true,
"overrides": [
{
"files": ["**/*.yml", "**/*.yaml"],
"options": {
"singleQuote": false
}
}
]
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If this is your first time contributing on GitHub, don't worry! Let us know if y

<https://github.com/canada-ca/ore-ero/>

______________________
---

## Comment contribuer

Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,20 @@ Notes:
- If Jekyll is not automatically regenerating the site after files are modified, add the build command flags: `--watch` and `--force_polling` to the end of the above command

Site will be available at: <http://localhost:4000/ore-ero/>
______________________

---

### Javascript

If you're working on Javascript in the `/assets/js/src` folder, make sure your code follows the style guidelines. We use ES Lint for checking code style. Ensure you have a recent version of Node.js (>=10.15.3). Run the following to install dependencies.

``` bash
```bash
npm install
```

Now when you want to know if your code is following the guidelines, run

``` bash
```bash
npm run lint
```

Expand Down Expand Up @@ -81,19 +82,19 @@ This service is hosted in [Heroku](https://dashboard.heroku.com/apps/canada-pr-b

First, clone PRB0t to your machine.

``` bash
```bash
git clone https://github.com/PRB0t/PRB0t
```

Next, add our app as a remote git repository.

``` bash
```bash
heroku git:remote -a canada-pr-bot
```

And finally, push your changes.

``` bash
```bash
git push heroku master
```

Expand Down Expand Up @@ -125,19 +126,20 @@ Remarques:
- Si Jekyll ne régénère pas automatiquement le site une fois les fichiers modifiés, ajoutez les indicateurs: `--watch` et `--force_polling` à la fin de la commande ci-dessus

Le site sera disponible au: <http://localhost:4000/ore-ero/>
______________________

---

### Javascript

Si vous travaillez sur Javascript dans le dossier `/assets/js/src`, assurez-vous que votre code respecte les directives de style. Nous utilisons ES Lint pour vérifier le style de code. Assurez-vous de disposer d'une version récente de Node.js (>=10.15.3). Exécutez ce qui suit pour installer des dépendances.

``` bash
```bash
npm install
```

Lorsque vous voulez savoir si votre code suit les directives de style, exécutez

``` bash
```bash
npm run lint
```

Expand Down Expand Up @@ -178,18 +180,18 @@ Ce service est hébergé sur [Heroku](https://dashboard.heroku.com/apps/canada-p

Commencez par cloner PRB0t sur votre machine.

``` bash
```bash
git clone https://github.com/PRB0t/PRB0t
```

Ensuite, ajoutez notre application en tant que dépôt git distant.

``` bash
```bash
heroku git:remote -a canada-pr-bot
```

Et enfin, poussez vos modifications.

``` bash
```bash
git push heroku master
```
20 changes: 12 additions & 8 deletions assets/gridify.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}

.tbl-gridify td:first-child {
padding-top:15px;
background:#f5f5f5;
padding-top: 15px;
background: #f5f5f5;
color: #333;
border: 1px solid #8e8e8e;
border-top-right-radius: 5px;
Expand All @@ -26,18 +26,22 @@
border-bottom-left-radius: 5px;
}

.tbl-gridify td:first-child.dataTables_empty{
.tbl-gridify td:first-child.dataTables_empty {
background: none !important;
}

.tbl-gridify td:first-child + td{
padding-top:15px;
.tbl-gridify td:first-child + td {
padding-top: 15px;
}

.tbl-gridify td:first-child a,.tbl-gridify td:first-child a:hover,.tbl-gridify td:first-child a:active,.tbl-gridify td:first-child a:focus,.tbl-gridify td:first-child a:visited{
color:#333 !important;
.tbl-gridify td:first-child a,
.tbl-gridify td:first-child a:hover,
.tbl-gridify td:first-child a:active,
.tbl-gridify td:first-child a:focus,
.tbl-gridify td:first-child a:visited {
color: #333 !important;
}

.tbl-gridify td {
padding:0 15px 15px 15px;
padding: 0 15px 15px 15px;
}
2 changes: 1 addition & 1 deletion assets/js/src/adminForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function resetNewAdminForm() {
function getAdminCode() {
if ($('#adminCode').val() == '') {
return slugify(
$('#ennewAdminName').val() + '-' + $('#provinceSelect').val()
$('#ennewAdminName').val() + '-' + $('#provinceSelect').val(),
);
}
return $('#adminCode').val();
Expand Down
18 changes: 9 additions & 9 deletions assets/js/src/codeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ function getCodeObject() {
codeObject.releases[0].description.howItWorks = {};
if ($('#endescriptionhowItWorks').val()) {
codeObject.releases[0].description.howItWorks.en = $(
'#endescriptionhowItWorks'
'#endescriptionhowItWorks',
).val();
}
if ($('#frdescriptionhowItWorks').val()) {
codeObject.releases[0].description.howItWorks.fr = $(
'#frdescriptionhowItWorks'
'#frdescriptionhowItWorks',
).val();
}
}
Expand Down Expand Up @@ -161,12 +161,12 @@ function submitFormAdminCodeForm() {

let codeName = codeObject.releases[0].name.en;
let adminName = slugify(
$('#ennewAdminName').val() + '-' + $('#provinceSelect').val()
$('#ennewAdminName').val() + '-' + $('#provinceSelect').val(),
);

let fileWriter = new YamlWriter(USERNAME, REPO_NAME);
let codeFile = `_data/code/${$('#orgLevel').val()}/${slugify(
$('#ennewAdminName').val() + '-' + $('#provinceSelect').val()
$('#ennewAdminName').val() + '-' + $('#provinceSelect').val(),
)}.yml`;
let adminFile = `_data/administrations/${getSelectedOrgType()}.yml`;

Expand All @@ -185,15 +185,15 @@ function submitFormAdminCodeForm() {
codeFile,
codeObject,
adminFile,
resultAdmin
resultAdmin,
);
} else throw err;
})
.then(function () {
let promises = getNewAdminPartnerPromise(
codeObject.releases[0],
fileWriter,
config
config,
);
Promise.all(promises)
.then(function () {
Expand All @@ -217,7 +217,7 @@ function getConfigNewAdmin(
codeFile,
codeObject,
adminFile,
resultAdmin
resultAdmin,
) {
return {
body: {
Expand Down Expand Up @@ -287,7 +287,7 @@ function submitCodeForm() {
let promises = getNewAdminPartnerPromise(
codeObject.releases[0],
fileWriter,
config
config,
);
Promise.all(promises)
.then(function () {
Expand Down Expand Up @@ -388,7 +388,7 @@ function selectAdmin() {
release.name[lang] +
'">' +
release.name[lang] +
'</option>'
'</option>',
).appendTo('#nameselect');
});
$('#nameselect').prop('disabled', false).parent().removeClass('hide');
Expand Down
Loading

0 comments on commit 7da9e90

Please sign in to comment.