Sharing Lint Rules
Your Global Lint Rules are kept in one file,
lint-rules.json, in a folder named epmwb-global in your EPM Workbench Root.
That folder is kept apart so a team can share it. Put it in a git repository,
and everyone’s editor flags the same things in the same way.
Before you start
Section titled “Before you start”Everyone who shares the Lint Rules needs a free GitHub account, and git on their computer. VS Code’s source control features use git.
- Open the Source Control view (
Ctrl+Shift+G, orCmd+Shift+Gon a Mac). - If VS Code says git is missing and offers a download link, follow it, install git, and restart VS Code.
- If you see the normal Source Control view instead, git is ready.
VS Code’s own source control documentation covers setup and sign-in in more detail.
Create the Global file
Section titled “Create the Global file”The file is created the first time you save something at the Global scope. In the Lint Rules panel, write a Lint Rule and set its Scope to Global, then click Save rule.
You can also create the file yourself: make a folder named epmwb-global in
your EPM Workbench Root, and a file in it named lint-rules.json. See
Edit lint-rules.json by hand
for what goes in it.
Only the Global file is shared this way. Level changes made with the
Error, Warning, Info, and Off buttons are saved for one Pod, and
Lint Exceptions are saved in the Pod Folder, so neither reaches your team. To
share a level, add it to the Global file’s configure section, for example
"calc/all-dimensions-accounted": "off".
Publish the Lint Rules (first teammate)
Section titled “Publish the Lint Rules (first teammate)”One person publishes the folder to GitHub. The Source Control view works on the
folder open in the window, so open epmwb-global by itself for these steps.
- Choose File > Open Folder and pick the
epmwb-globalfolder in your EPM Workbench Root. The window now shows only that folder. - Open the Source Control view.
- Click Publish to GitHub. If you see Initialize Repository instead,
click that first, then publish. Keep the name
epmwb-global. - Choose the private repository option.
- Sign in to GitHub when VS Code asks, and approve the request in the browser window it opens.
- On GitHub, open the new repository, go to Settings > Collaborators, and invite each teammate. They need to accept before they can get the files.
- Go back to your usual window with File > Open Recent, and pick your EPM Workbench Root.
From then on, VS Code finds the repository on its own. Your usual window’s
Source Control view lists epmwb-global as a repository of its own.
Get the Lint Rules (everyone else)
Section titled “Get the Lint Rules (everyone else)”- Open the Command Palette (
Ctrl+Shift+P, orCmd+Shift+Pon a Mac) and run Git: Clone. - Paste the repository address your teammate sends you.
- When VS Code asks where to put it, choose your EPM Workbench Root. The
folder lands at
epmwb-globalin your Root, which is where EPM Workbench looks for it. - When VS Code offers to open the cloned folder, choose Add to Workspace, or say no and stay in your usual window. Either way, the Lint Rules apply.
Day to day
Section titled “Day to day”Change Lint Rules the same way as before, in the panel or in the file. Then send the change to your team:
- Open the Source Control view. Changed files show under the
epmwb-globalrepository. - Type a short message that says what changed, for example
turn off calc/all-dimensions-accounted. - Click Commit.
- Click Sync Changes to send it to GitHub.
Teammates get your changes with Sync Changes too. Sync before you start changing Lint Rules, as with any shared file. If someone else changed the same lines in the meantime, VS Code shows both versions and asks you which to keep.
Changes apply as soon as the file changes, so a change you sync in takes effect without restarting VS Code.