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
177 changes: 154 additions & 23 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,155 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"env": { "node": true },
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
"@typescript-eslint/ban-ts-comment": "off",
"no-prototype-builtins": "off",
"@typescript-eslint/no-empty-function": "off",
"no-case-declarations": "off"
}
}
"root": true,
"parser": "@typescript-eslint/parser",
"env": {
"node": true
},
"plugins": [
"@typescript-eslint",
"@stylistic/eslint-plugin"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"@stylistic/indent": [
"error",
"tab"
],
"@stylistic/indent-binary-ops": [
"error",
"tab"
],
"@stylistic/quotes": [
"error",
"single"
],
"@stylistic/semi": [
"error",
"always"
],
"@stylistic/brace-style": [
"error",
"stroustrup",
{
"allowSingleLine": true
}
],
"@stylistic/comma-dangle": [
"error",
"always-multiline"
],
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"@stylistic/dot-location": [
"error",
"property"
],
"@stylistic/function-call-argument-newline": [
"error",
"consistent"
],
"@stylistic/function-call-spacing": "error",
"@stylistic/implicit-arrow-linebreak": "error",
"@stylistic/key-spacing": "error",
"@stylistic/lines-around-comment": [
"error",
{
"beforeBlockComment": true,
"afterBlockComment": false,
"beforeLineComment": true,
"afterLineComment": false,
"allowBlockStart": true,
"allowBlockEnd": false,
"allowClassStart": true,
"allowClassEnd": false,
"allowObjectStart": true,
"allowObjectEnd": false,
"allowArrayStart": true,
"allowArrayEnd": false,
"ignorePattern": "TODO|HACK|BUG|TEST",
"applyDefaultIgnorePatterns": false
}
],
"@stylistic/new-parens": "error",
"@stylistic/no-confusing-arrow": "error",
"@stylistic/no-extra-semi": "error",
"@stylistic/no-floating-decimal": "error",
"@stylistic/no-mixed-operators": "error",
"@stylistic/no-mixed-spaces-and-tabs": "error",
"@stylistic/no-multi-spaces": "error",
"@stylistic/no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxEOF": 0,
"maxBOF": 0
}
],
"@stylistic/no-trailing-spaces": [
"error",
{
"skipBlankLines": false,
"ignoreComments": false
}
],
"@stylistic/nonblock-statement-body-position": "error",
"@stylistic/operator-linebreak": [
"error",
"after"
],
"@stylistic/padded-blocks": [
"error",
"never"
],
"@stylistic/padding-line-between-statements": "error",
"@stylistic/rest-spread-spacing": "error",
"@stylistic/semi-spacing": "error",
"@stylistic/semi-style": "error",
"@stylistic/space-before-blocks": "error",
"@stylistic/space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"@stylistic/arrow-spacing": "error",
"@stylistic/space-in-parens": "error",
"@stylistic/space-infix-ops": "error",
"@stylistic/space-unary-ops": "error",
"@stylistic/spaced-comment": [
"error",
"always"
],
"@stylistic/switch-colon-spacing": "error",
"@stylistic/template-curly-spacing": "error",
"@stylistic/type-generic-spacing": "error",
"@stylistic/type-named-tuple-spacing": "error",
"no-fallthrough": [
"error",
{
"allowEmptyCase": true
}
],
"line-comment-position": [
"error",
{
"position": "above",
"ignorePattern": "TODO|HACK|BUG|TEST",
"applyDefaultIgnorePatterns": false
}
]
}
}
8 changes: 8 additions & 0 deletions .eslintrc.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"./.eslintrc"
],
"rules": {
"no-console": "off",
}
}
21 changes: 21 additions & 0 deletions .eslintrc.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": [
"./.eslintrc"
],
"rules": {
"no-console": [
"error",
{
"allow": [
"warn",
"error",
"debug"
]
}
],
"multiline-comment-style": [
"error",
"starred-block"
]
}
}
115 changes: 80 additions & 35 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,91 @@
# Welcome to Settings profiles contributing guide
Thank you for investing your time in contributing to this plugin!
Thank you for taking the time to contribute to this plugin!

In this guide you will get an overview of the contribution workflow from opening an issue, creating a pull request, and testing the plugin.
This guide will walk you through the contribution workflow - from [reporting issues](#reporting-issues) and [making changes](#making-changes), to [submitting a pull request](#pull-requests) and [testing the plugin](#testing-the-plugin).

## Getting started
### Issues
#### Create a new issue
If you spot a problem with the plugin, [search if an issue already exists](https://github.com/4Source/settings-profiles-obsidian-plugin/issues). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/4Source/settings-profiles-obsidian-plugin/issues/new/choose).
# Getting started
## Reporting Issues
### 1. Check for existing issues
If you encounter a problem, first <a href="../../../issues">search the issue tracker</a> to see if it has already been reported.
- If an there is an existing issue and you can provide additional information add a comment with your information.
- If you just want to indicate that you are experiencing the same issue, add a :+1: reaction to the issue.
### 2. Create a new Issue
If not related issue exists, open a new one using the appropriate <a href="../../../issues/new/choose">issue form</a>.

#### Solve an issue
Scan through the [existing issues](https://github.com/4Source/settings-profiles-obsidian-plugin/issues) to find one that interests you. If you find an issue to work on, you are welcome to [open a PR](#pull-request) with a fix.
## Working on an Issue
#### 1. Browse <a href="../../../issues">existing issues</a> to find something you'd like to work on.
#### 2. Comment on the issue to let others know you're working on it.
#### 3. Follow the [making changes](#making-changes) guide below.
#### 4. When ready, submit a [pull request](#pull-request).

### Make changes
1. Fork the repository.
2. Install [**Git**](https://git-scm.com/) on your local machine.
3. Install or update [**Node.js**](https://nodejs.org/en) version at least `18.x`.
4. You will need a code editor, such as [Visual Studio Code](https://code.visualstudio.com/)
5. Clone repository to your local machine.
- Create a new vault
- ``cd path/to/vault``
- ``mkdir .obsidian/plugins``
- ``cd .obsidian/plugins``
- ``git clone <your-repository-url> settings-profiles``
6. Install dependencies
- ``cd settings-profiles``
- ``npm install``
7. Create a working branch and start with your changes!
- ``git branch <working-branch> master``
- ``git checkout <working-branch>``
8. Compile the source code. The following command keeps running in the terminal and rebuilds the plugin when you modify the source code.
- ``npm run dev``
9. Enable the plugin in Obsidian settings
## Making Changes
### What you need:
- [**Git**](https://git-scm.com/) on your local machine.
- [**Node.js**](https://nodejs.org/en) at least version `18.x`.
- Code editor, such as [Visual Studio Code](https://code.visualstudio.com/)
### Start working:
#### 1. Fork the repository.
#### 2. Create a new vault
Just for testing the plugin so you **can't** exedentially destroy your real vault
#### 3. Clone repository to your local machine.
```shell
cd path/to/vault
mkdir .obsidian/plugins
cd .obsidian/plugins
git clone <your-fork-url> <plugin-id>
```
#### 4. Install dependencies
```shell
cd <plugin-id>
npm install
```
#### 5. Create a working branch
```shell
git checkout -b <working-branch>
```
#### 6. Compile the source code
The following command keeps running in the terminal and rebuilds the plugin when you modify the source code.
```shell
npm run dev
```
#### 7. Enable the plugin in Obsidian settings
> [!TIP]
> Install the [Hot-Reload](https://github.com/pjeby/hot-reload) plugin to automatically reload the plugin while developing.

### Commit your update
Commit the changes once you are happy with them.
## Committing Your Changes
#### 1. Check the formatting of your code
Before committing the following command will fix most of the formatting issues according to our ESLint configuration.
```shell
npm run lint-fix
```
If you see the following output without any errors the formatting matches the the requirements if any errors remain, fix them manually before proceeding.
```output
> eslint . --fix --config .eslintrc.release
```
#### 2. Create commit
Than commit your changes with a clear, descriptive commit message.

### Pull Request
When you're finished with the changes, push them to your fork and create a pull request. Make sure you fill the pull request template.
## Pull Requests
#### 1. Run tests before submitting
```shell
npm run test
```
- Ensure all tests pass.
- If new tests are needed, add them or note what should be tested in your PR.
#### 2. Push your Branch to your fork
#### 3. Open a Pull Request using the provided template
#### 4. Reference any related issues

### Test plugin
*Not a developer* but still want to help? You can help with testing. Either you test the current version for possible problems or, if there are currently any, you can also test [pre-releases (alpha/beta)](https://github.com/4Source/settings-profiles-obsidian-plugin/releases). You need to install the version you wanna test in a vault. It is not recommendet to test in your acctual vault create a copy of it or create new one for testing. If you found a bug or unexpected behavior create an [issue](https://github.com/4Source/SettingsProfiles-Obsidian-Plugin/issues) with the version you have tested. Before creating an issue, make sure you know how to reproduce the bug. If there is already an issue for the bug you found that is still open but you have additional information, add it to the issue.
## Testing the Plugin
*Not a developer* but still want to help? You can help with testing:
- Test the latest <a href="../../../releases">release</a> for problems
- Test <a href="../../../releases">pre-releases</a>
### How to test
#### 1. Do **not** test in your actual vault - create new vault just for testing
#### 2. Install the version you want to test in the vault
> [!TIP]
> Install the [VARE](https://obsidian.md/plugins?id=vare) plugin to easily switch versions while testing.
#### 3. If you found a bug or unexpected behavior
- Checkout [reporting issues](#reporting-issues)
- Make sure you know how to reproduce the bug
- Mention the version you have tested
- Provide screenshots/videos or your testfiles to make it easier to reproduce
8 changes: 6 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ body:
attributes:
label: How to Reproduce
description: Steps to reproduce the behavior.
placeholder: "1. In this environment..., 2. With this config..., 3. Run..., 4. See error..."
placeholder: |
1. In this environment...
2. With this config...
3. Run...
4. See error...
validations:
required: true
- type: textarea
Expand All @@ -31,7 +35,7 @@ body:
id: operating-system
attributes:
label: OS of your device
description: What operating system is your device runnging
description: What operating system is your device running
placeholder: e.g. Win10
validations:
required: true
Expand Down
8 changes: 7 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Community Support
url: "../../../discussions"
url: https://github.com/4Source/settings-profiles-obsidian-plugin/discussions
about: Please ask and answer questions here.
- name: Documentation
url: https://github.com/4Source/settings-profiles-obsidian-plugin/wiki
about: Check out the documentation if you want to know what's possible.
- name: Contributing
url: https://github.com/4Source/settings-profiles-obsidian-plugin/blob/master/.github/CONTRIBUTING.md
about: Overview of the contribution workflow
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ body:
required: false
- type: markdown
attributes:
value: "Thanks for taking the time to fill out this feature request!"
value: "Thanks for taking the time to fill out this feature request!"
Loading
Loading