Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/sqlfluff/sqlfluff
/ functions
Functions
2,340 in github.com/sqlfluff/sqlfluff
⨍
Functions
2,340
◇
Types & classes
2,379
↳
Endpoints
59
↓ 767 callers
Method
keyword
Generate a reference to a keyword by name. This function is entirely syntactic sugar, and designed for more readable dialects.
src/sqlfluff/core/parser/grammar/base.py:430
↓ 643 callers
Method
append
Combine another subsequent match onto this one. NOTE: Because MatchResult is frozen, this returns a new match.
src/sqlfluff/core/parser/match_result.py:119
↓ 415 callers
Method
is_type
Extend the parent class method with the surrogate types.
src/sqlfluff/core/parser/segments/raw.py:153
↓ 225 callers
Method
sets
Allows access to sets belonging to this dialect. These sets belong to the dialect and are copied for sub dialects. These are used in
src/sqlfluff/core/dialects/base.py:96
↓ 213 callers
Method
join
(self)
test/core/linter/linter_test.py:348
↓ 196 callers
Method
copy
Return a copy of self with a separate register.
src/sqlfluff/core/rules/base.py:1229
↓ 172 callers
Method
get
Get a particular value from the config. Args: val (str): The name of the config value to get. section (str or iterabl
src/sqlfluff/core/config/fluffconfig.py:522
↓ 122 callers
Method
replace
Replace supplied anchor segment with the edit segments.
src/sqlfluff/core/rules/fix.py:236
↓ 99 callers
Method
get
Return configured value for ``recursion_limit``; else default.
test/cli/recursion_limit_test.py:17
↓ 93 callers
Method
write
Write message to stdout.
src/sqlfluff/cli/outputstream.py:40
↓ 88 callers
Method
get_child
Retrieve the first of the children of this segment with matching type.
src/sqlfluff/core/parser/segments/base.py:1029
↓ 84 callers
Method
children
Children could be CTEs, subselects or Others.
src/sqlfluff/utils/analysis/query.py:193
↓ 84 callers
Method
get
Return specified item. Returns default if index out of range.
src/sqlfluff/utils/functional/segments.py:179
↓ 79 callers
Method
get_grammar
Allow access to grammars pre-expansion. This is typically for dialect inheritance. This method also validates that the result is a gr
src/sqlfluff/core/dialects/base.py:253
↓ 75 callers
Method
recursive_crawl
Recursively crawl for segments of a given type.
src/sqlfluff/utils/functional/segments.py:112
↓ 71 callers
Method
lint_string
Lint a string. Returns: :obj:`LintedFile`: an object representing that linted file.
src/sqlfluff/core/linter/linter.py:1066
↓ 68 callers
Method
add
Add a timing dictionary to the summary.
src/sqlfluff/core/timing.py:14
↓ 63 callers
Function
invoke_assert_code
Invoke a command and check return code.
src/sqlfluff/utils/testing/cli.py:9
↓ 58 callers
Method
select
Retrieve range/subset. NOTE: Iterates the segments BETWEEN start_seg and stop_seg, i.e. those segments are not included in the loop.
src/sqlfluff/utils/functional/segments.py:192
↓ 55 callers
Method
match
Match a list of segments against this segment. Matching can be done from either the raw or the segments. This raw function can be ove
src/sqlfluff/core/parser/grammar/base.py:386
↓ 54 callers
Method
delete
Delete supplied anchor segment.
src/sqlfluff/core/rules/fix.py:231
↓ 47 callers
Method
lint
Return just the violations from lintfix when we're only linting.
src/sqlfluff/core/linter/linter.py:1045
↓ 46 callers
Method
from_string
Create TemplatedFile from a string.
src/sqlfluff/core/templaters/base.py:239
↓ 46 callers
Method
parse_string
Parse a string.
src/sqlfluff/core/linter/linter.py:995
↓ 43 callers
Method
insert_lexer_matchers
Insert new records into an existing lexer struct. Used to edit the lexer of a sub-dialect. The patch is inserted *before* whichever e
src/sqlfluff/core/dialects/base.py:370
↓ 37 callers
Method
_add_string
Add string to table (deduplicated). Returns string_id.
utils/build_parsers.py:126
↓ 37 callers
Method
lex
Take a string or TemplatedFile and return segments. If we fail to match the *whole* string, then we must have found something that we
src/sqlfluff/core/parser/lexer.py:752
↓ 36 callers
Method
first
Returns the first segment (if any) that satisfies the predicates.
src/sqlfluff/utils/functional/segments.py:132
↓ 34 callers
Function
fmt
(val: Any, width: int = 12)
utils/compare_parser_metrics.py:344
↓ 32 callers
Method
colorize
Optionally use ANSI colour codes to colour a string.
src/sqlfluff/cli/formatters.py:283
↓ 32 callers
Function
load_raw_dialect
Dynamically load a dialect.
src/sqlfluff/core/dialects/__init__.py:67
↓ 30 callers
Method
empty_at
Create an empty match at a particular index.
src/sqlfluff/core/parser/match_result.py:111
↓ 30 callers
Method
search
Use regex to find a substring.
src/sqlfluff/core/parser/lexer.py:336
↓ 28 callers
Method
copy_as
Copy this dialect and create a new one with a different name. This is the primary method for inheritance, after which, the `replace`
src/sqlfluff/core/dialects/base.py:132
↓ 27 callers
Method
fix
Return the fixed tree and violations from lintfix when we're fixing.
src/sqlfluff/core/linter/linter.py:1024
↓ 27 callers
Method
get_violations
Return a list of violations in the path.
src/sqlfluff/core/linter/linted_dir.py:186
↓ 26 callers
Method
exit
Pop a block from the stack.
src/sqlfluff/core/parser/lexer.py:72
↓ 25 callers
Method
get_section
Return a whole section of config as a dict. If the element found at the address is a value and not a section, it is still returned an
src/sqlfluff/core/config/fluffconfig.py:558
↓ 24 callers
Method
update_keywords_set_from_multiline_string
Special function to update a keywords set from a multi-line string.
src/sqlfluff/core/dialects/base.py:124
↓ 23 callers
Method
num_newlines
Return the number of newlines in this element. These newlines are either newline segments or contained within consumed sections of wh
src/sqlfluff/utils/reflow/elements.py:90
↓ 23 callers
Method
raw_normalized
Returns a normalized string of the raw content. E.g. This removes leading and trailing quote characters, removes escapes, optionally
src/sqlfluff/core/parser/segments/raw.py:208
↓ 23 callers
Method
stringify
Use indentation to render this segment and its children as a string. Args: ident (int, optional): The indentation level. Defaults
src/sqlfluff/core/parser/segments/raw.py:222
↓ 22 callers
Method
desc
Fetch a description of this violation.
src/sqlfluff/core/errors.py:104
↓ 22 callers
Method
from_root
Given a root segment, find the first appropriate selectable and analyse.
src/sqlfluff/utils/analysis/query.py:295
↓ 22 callers
Function
generate_test_segments
Roughly generate test segments. This is a factory function so that it works as a fixture, but when actually used, this will return the inner
test/conftest.py:258
↓ 22 callers
Method
to_tuple
Return a tuple structure from this segment.
src/sqlfluff/core/parser/segments/base.py:877
↓ 21 callers
Method
fix_string
Obtain the changes to a path as a string. We use the source mapping features of TemplatedFile to generate a list of "patches" which c
src/sqlfluff/core/linter/linted_file.py:195
↓ 20 callers
Method
get_children
Retrieve the all of the children of this segment with matching type.
src/sqlfluff/core/parser/segments/base.py:1036
↓ 20 callers
Method
is_literal
Infer literalness from context. is_literal should return True if a fix can be applied across this area in the templated file while be
src/sqlfluff/core/parser/markers.py:267
↓ 19 callers
Method
check_tuples
Compress all the tuples into one list. NB: This is a little crude, as you can't tell which file the violations are from. Good for tes
src/sqlfluff/core/linter/linted_dir.py:141
↓ 19 callers
Method
from_kwargs
Instantiate a config from a subset of common options. Args: dialect (str, optional): The name of the dialect to use.
src/sqlfluff/core/config/fluffconfig.py:396
↓ 19 callers
Method
rule_code
Fetch the code of the rule which cause this error.
src/sqlfluff/core/errors.py:96
↓ 18 callers
Function
DummySegment
Construct a raw segment as a fixture.
test/core/parser/segments/conftest.py:21
↓ 18 callers
Method
patch_lexer_matchers
Patch an existing lexer struct. Used to edit the lexer of a sub-dialect.
src/sqlfluff/core/dialects/base.py:350
↓ 18 callers
Method
path_to
Given a segment which is assumed within self, get the intermediate segments. Returns: :obj:`list` of :obj:`PathStep`, not includi
src/sqlfluff/core/parser/segments/base.py:1127
↓ 17 callers
Method
find
Returns index if found, -1 if not found.
src/sqlfluff/utils/functional/segments.py:48
↓ 17 callers
Method
get_type
Returns the type of this segment as a string.
src/sqlfluff/core/parser/segments/raw.py:147
↓ 17 callers
Method
last
Returns the last segment (if any) that satisfies the predicates.
src/sqlfluff/utils/functional/segments.py:143
↓ 17 callers
Method
lint_path
Lint a path.
src/sqlfluff/core/linter/linter.py:1125
↓ 16 callers
Function
DummyAuxSegment
Construct a raw segment as a fixture.
test/core/parser/segments/conftest.py:33
↓ 16 callers
Method
edit
Create a new segment, with exactly the same position but different content. Args: raw (Optional[str]): The new content for the se
src/sqlfluff/core/parser/segments/raw.py:249
↓ 16 callers
Method
indent_to
Coerce a point to have a particular indent. If the point currently contains no newlines, one will be introduced and any trailing whit
src/sqlfluff/utils/reflow/elements.py:413
↓ 16 callers
Method
lint_paths
Lint an iterable of paths.
src/sqlfluff/core/linter/linter.py:1138
↓ 15 callers
Method
create_after
Create edit segments after the supplied anchor segment.
src/sqlfluff/core/rules/fix.py:261
↓ 15 callers
Method
deeper_match
Increment match depth. Args: name (:obj:`str`): Name of segment we are starting to parse. NOTE: This value is ent
src/sqlfluff/core/parser/context.py:239
↓ 15 callers
Method
parse
Parse the up/down blocks.
test/core/templaters/jinja_test.py:1048
↓ 14 callers
Method
create_before
Create edit segments before the supplied anchor segment.
src/sqlfluff/core/rules/fix.py:246
↓ 14 callers
Function
paths_from_path
Return a set of sql file paths from a potentially more ambiguous path string. Here we also deal with the any ignore files file if present, whethe
src/sqlfluff/core/linter/discovery.py:244
↓ 13 callers
Method
add
Add a segment to the dialect directly. This is the alternative to the decorator route, most useful for segments defined using `make`.
src/sqlfluff/core/dialects/base.py:168
↓ 13 callers
Method
any
Do any of the segments match?
src/sqlfluff/utils/functional/segments.py:62
↓ 13 callers
Method
apply
Apply function to every item.
src/sqlfluff/utils/functional/segments.py:188
↓ 13 callers
Method
bracket_sets
Allows access to bracket sets belonging to this dialect.
src/sqlfluff/core/dialects/base.py:113
↓ 13 callers
Method
cli_table
Make a crude ascii table. Assume that `fields` is an iterable of (label, value) pairs.
src/sqlfluff/cli/formatters.py:357
↓ 13 callers
Function
dialect_readout
Generate a readout of available dialects.
src/sqlfluff/core/dialects/__init__.py:89
↓ 13 callers
Method
end_point_marker
Get a point marker from the end.
src/sqlfluff/core/parser/markers.py:222
↓ 13 callers
Function
get_plugin_manager
Initializes the PluginManager. NOTE: We cache the plugin manager as a global to avoid reloading all the plugins each time.
src/sqlfluff/core/plugin/host.py:83
↓ 13 callers
Method
increment_parse_nodes
Increment the number of materialized parse nodes. Args: count (int): Number of nodes to add to the current budget.
src/sqlfluff/core/parser/context.py:147
↓ 12 callers
Method
_dispatch
Dispatch a string to the callback. This method is designed as a point for subclassing.
src/sqlfluff/cli/formatters.py:113
↓ 12 callers
Method
_flatten_list
Flatten list of grammars. Returns list of GrammarIds.
utils/build_parsers.py:213
↓ 12 callers
Method
_get_children
(segments: Segments)
src/sqlfluff/rules/convention/CV11.py:64
↓ 12 callers
Method
as_records
Return the result as a list of dictionaries. Each record contains a key specifying the filepath, and a list of violations. This metho
src/sqlfluff/core/linter/linted_dir.py:192
↓ 12 callers
Function
get_config
Get a config object from kwargs.
src/sqlfluff/cli/commands.py:477
↓ 12 callers
Method
is_type
(self, _type: str)
test/rules/std_AM09_test.py:68
↓ 12 callers
Method
process
Process a string and return the new string. Note that the arguments are enforced as keywords because Templaters can have differences
src/sqlfluff/core/templaters/jinja.py:703
↓ 12 callers
Method
run
(self, fnames, fix)
test/core/linter/linter_test.py:599
↓ 11 callers
Method
_build_flags
Build flags bitfield from grammar attributes.
utils/build_parsers.py:221
↓ 11 callers
Method
all
Do all the segments match?
src/sqlfluff/utils/functional/segments.py:55
↓ 11 callers
Method
class_is_type
Is this segment class (or its parent) of the given type.
src/sqlfluff/core/parser/segments/base.py:610
↓ 11 callers
Method
flatten_grammar
Recursively flatten Grammar tree to tables. Returns GrammarId for this node.
utils/build_parsers.py:251
↓ 11 callers
Method
from_path
Loads a config object given a particular path. Args: path (str): The target path to load config files from. Files
src/sqlfluff/core/config/fluffconfig.py:342
↓ 11 callers
Method
from_segment
Recursively generate a query from an appropriate segment.
src/sqlfluff/utils/analysis/query.py:306
↓ 11 callers
Method
iter_raw_references
Generate a list of reference strings and elements. Each reference is an ObjectReferencePart. If some are split, then a segment may ap
src/sqlfluff/dialects/dialect_ansi.py:1106
↓ 11 callers
Method
replace
Returns a new :obj:`ReflowSequence` with `edit` elements replaced. This generates appropriate replacement :obj:`LintFix` objects to direct
src/sqlfluff/utils/reflow/sequence.py:416
↓ 11 callers
Method
source_position
Return the line and position of this marker in the source.
src/sqlfluff/core/parser/markers.py:146
↓ 10 callers
Method
_add_simple_hint
Precompute and add simple hint. Returns hint_id (0 = None).
utils/build_parsers.py:162
↓ 10 callers
Method
as_record
Return the segment as a structurally simplified record. This is useful for serialization to yaml or json. kwargs passed to to_tuple
src/sqlfluff/core/parser/segments/base.py:985
↓ 10 callers
Function
dialect_selector
Return a dialect given its name.
src/sqlfluff/core/dialects/__init__.py:101
↓ 10 callers
Function
fluff_log_catcher
Context manager that sets the level for capturing of logs. After the end of the 'with' statement the level is restored to its original value.
src/sqlfluff/utils/testing/logging.py:68
↓ 10 callers
Method
get_rulepack
Get hold of a set of rules.
src/sqlfluff/core/linter/linter.py:101
↓ 10 callers
Function
is_zero_slice
Return true if this is a zero slice.
src/sqlfluff/core/helpers/slice.py:16
next →
1–100 of 2,340, ranked by callers