code-style
Skill592 starsChanged 9 months agoMITView on GitHub
Guide for running code style linters and formatters. Use this when asked to check code style, run linters, or fix formatting issues.
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill when you need to:
- Distinctive: line 13
Check code for style violations
- Distinctive: line 15
Verify type correctness with mypy
- Distinctive: line 17
Ensure code follows project standards
- Distinctive: line 132
When mypy raises false positives:
- Distinctive: line 183
Before committing code changes:
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Style and Linting
This skill covers code style checking and formatting workflows for the Semantic Link Labs project.
When to Use This Skill
Use this skill when you need to:
- Check code for style violations
- Format code with black
- Verify type correctness with mypy
- Fix linting errors before committing
- Ensure code follows project standards
Formatting Tools
| Tool | Purpose | Configuration |
| black | Code formatting | pyproject.toml |
| flake8 | Style checking | pyproject.toml |
| mypy | Type checking | pyproject.toml |
Code Formatting with Black
The project uses black for code formatting.
Running Black
# Format all source files
black src/sempy_labs tests
# Check without modifying (dry run)
black --check src/sempy_labs tests
# Show diff of changes
black --diff src/sempy_labs tests
# Format specific file
black src/sempy_labs/_workspaces.pyBlack Configuration
From pyproject.toml, max line length is configured via flake8 settings.
Style Checking with Flake8
Running Flake8
# Check all source files
flake8 src/sempy_labs tests
# Check specific file
flake8 src/sempy_labs/_helper_functions.py
# Show source code for each error
flake8 --show-source src/sempy_labs
# Show statistics summary
flake8 --statistics src/sempy_labsFlake8 Configuration
From pyproject.toml:
[tool.flake8]
max-line-length = 200Common Flake8 Errors
| Code | Description | Fix |
| E501 | Line too long (>200 chars) | Break line or shorten code |
| F401 | Imported but unused | Remove unused import |
| F841 | Variable assigned but never used | Remove or use the variable |
| E302 | Expected 2 blank lines | Add blank lines between functions |
| E303 | Too many blank lines | Remove extra blank lines |
| W291 | Trailing whitespace | Remove trailing spaces |
| E711 | Comparison to None | Use is None instead of == None |
Type Checking with Mypy
Running Mypy
# Check all source files
mypy src/sempy_labs
# Check specific file
mypy src/sempy_labs/_workspaces.py
# Show error codes
mypy --show-error-codes src/sempy_labsMypy Configuration
From pyproject.toml:
[[tool.mypy.overrides]]
module = "sempy.*,Microsoft.*,System.*,anytree.*,synapse.ml.services.*,polib.*,jsonpath_ng.*,anywidget.*,sqlglot.*"
ignore_missing_imports = trueCommon Mypy Errors
| Error | Description | Fix |
Incompatible types | Type mismatch | Fix type annotation or value |
Missing return statement | Function missing return | Add return statement |
Argument has incompatible type | Wrong argument type | Pass correct type |
has no attribute | Attribute doesn't exist | Check spelling or type |
Adding Type Ignore Comments
When mypy raises false positives:
# Ignore specific error
result = some_function() # type: ignore[return-value]
# Ignore all errors on line
result = some_function() # type: ignoreImport Organization
Import Order
Organize imports in this order (with blank lines between groups):
- Standard library imports
- Third-party imports
- Local application imports
Example Import Structure
# Standard library
import os
import json
from typing import Optional, List
from uuid import UUID
# Third-party
import pandas as pd
import requests
# Semantic Link (dependency)
import sempy.fabric as fabric
from sempy._utils._log import log
# Local imports
import sempy_labs._icons as icons
from sempy_labs._helper_functions import (
resolve_workspace_id,
_base_api,
)Pre-Commit Style Checklist
Before committing code changes:
# Format code
black src/sempy_labs tests
# Check for style issues
flake8 src/sempy_labs tests
# Check types (optional)
mypy src/sempy_labs
# If any errors, fix and re-runCommon Style Fixes
Line Too Long
Break long lines using parentheses or backslash:
# Before
result = some_very_long_function_call(parameter1, parameter2, parameter3, parameter4, parameter5)
# After
result = some_very_long_function_call(
parameter1,
parameter2,
parameter3,
parameter4,
parameter5
)F-String Line Breaks
# Before
print(f"{icons.green_dot} The '{item_name}' {item_type} has been successfully created in the '{workspace_name}' workspace.")
# After (if too long)
print(
f"{icons.green_dot} The '{item_name}' {item_type} has been successfully "
f"created in the '{workspace_name}' workspace."
)Dictionary Formatting
# Before
payload = {"displayName": name, "description": description, "definition": definition}
# After
payload = {
"displayName": name,
"description": description,
"definition": definition,
}IDE Integration
VS Code Settings
Recommended .vscode/settings.json:
{
"python.formatting.provider": "black",
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
}
}Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- facebook/docusaurus★ 67ksame name
- JetBrains/intellij-community★ 21ksame name
- DetachHead/rebased★ 6ksame name
- latitude-dev/latitude-llm★ 4.7ksame name
- Pixeval/Pixeval★ 3.2ksame name
- JetBrains/MPS★ 1.7ksame name
- Automattic/wordpress-activitypub★ 583same name
- meleantonio/ChernyCode★ 516same name
- RailtownAI/railtracks★ 234same name
- frappe/skills★ 162same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use ssr, actions and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
JetBrainsSkillssr
Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns.
Also in 3 projects that use this
JetBrainsSkillactions
Guidelines for implementing IntelliJ actions (AnAction). Use those rules when you need to create or change an action in the intellij platform.
Also in 3 projects that use this
BlockSkilldebugging
Debugging guidelines and best practices
Also in 3 projects that use this
NVIDIASkilltesting
Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.
Also in 4 projects that use this
- +2 more from JetBrains
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-functionSkill
- build-docsSkill
- dax-optimizationSkill
- direct-lake-operationsSkill
- github-repo-exploreSkill
- planning-with-filesSkill
- pr-review-commentsSkill
- query-builder-daxSkill
- rest-api-patternsSkill
- run-testsSkill
- sql_to_daxSkill
- tom-operationsSkill
- ui-stylingSkill
- write-testsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

