repo
stringclasses
15 values
pull_number
int64
147
18.3k
instance_id
stringlengths
14
31
issue_numbers
listlengths
1
3
base_commit
stringlengths
40
40
patch
stringlengths
289
585k
test_patch
stringlengths
355
6.82M
problem_statement
stringlengths
25
49.4k
hints_text
stringlengths
0
58.9k
created_at
timestamp[us, tz=UTC]date
2014-08-08 22:09:38
2024-06-28 03:13:12
version
stringclasses
110 values
PASS_TO_PASS
listlengths
0
4.82k
FAIL_TO_PASS
listlengths
1
1.06k
language
stringclasses
4 values
image_urls
listlengths
0
4
website links
listlengths
0
4
statsmodels/statsmodels
8,889
statsmodels__statsmodels-8889
[ "4751" ]
77cb066320391ffed4196a32491ddca28e8c9122
diff --git a/statsmodels/genmod/generalized_linear_model.py b/statsmodels/genmod/generalized_linear_model.py --- a/statsmodels/genmod/generalized_linear_model.py +++ b/statsmodels/genmod/generalized_linear_model.py @@ -54,6 +54,7 @@ # need import in module instead of lazily to copy `__doc__` from . import families ...
diff --git a/statsmodels/discrete/tests/test_sandwich_cov.py b/statsmodels/discrete/tests/test_sandwich_cov.py --- a/statsmodels/discrete/tests/test_sandwich_cov.py +++ b/statsmodels/discrete/tests/test_sandwich_cov.py @@ -9,6 +9,8 @@ import os import numpy as np import pandas as pd +import pytest + import statsmod...
ENH: add GLM Margins and supporting helper functions GEE has margins, although incomplete, see #3704 GLM has nothing related yet. To compute hatmatrix or, more precisely, generalized leverage for generic MLE that have predict, I need one method d mu / d params, which is in discrete_models used for the margin comput...
I just realized (again) that GLMResults still does not have `get_margeff` We need it to e.g. compare logit and probit, Binomial with different link functions, params have different scaling and cannot be directly compared. see also #8802 for another reason to look at margins in binomial If we don't want to support ...
2023-05-19T16:30:44Z
0.14
[ "statsmodels/discrete/tests/test_sandwich_cov.py::TestNegbinCluExposureFit::test_basic", "statsmodels/discrete/tests/test_sandwich_cov.py::TestNegbinCluExposureFit::test_waldtest", "statsmodels/discrete/tests/test_sandwich_cov.py::TestNegbinCluExposureFit::test_ttest", "statsmodels/discrete/tests/test_sandwic...
[ "statsmodels/discrete/tests/test_sandwich_cov.py::TestGLMProbit::test_margeff", "statsmodels/discrete/tests/test_sandwich_cov.py::TestGLMPoisson::test_margeff", "statsmodels/discrete/tests/test_sandwich_cov.py::TestGLMLogit::test_margeff" ]
Python
[]
[]
statsmodels/statsmodels
8,907
statsmodels__statsmodels-8907
[ "8905" ]
77cb066320391ffed4196a32491ddca28e8c9122
diff --git a/statsmodels/base/model.py b/statsmodels/base/model.py --- a/statsmodels/base/model.py +++ b/statsmodels/base/model.py @@ -1639,7 +1639,11 @@ def t_test(self, r_matrix, cov_p=None, use_t=None): """ from patsy import DesignInfo use_t = bool_like(use_t, "use_t", strict=True, optiona...
diff --git a/statsmodels/discrete/tests/test_discrete.py b/statsmodels/discrete/tests/test_discrete.py --- a/statsmodels/discrete/tests/test_discrete.py +++ b/statsmodels/discrete/tests/test_discrete.py @@ -2586,16 +2586,15 @@ def test_cov_confint_pandas(): assert isinstance(ci.index, pd.MultiIndex) -def test_...
BUG: base t_test incorrect ravel for MNLogit, cov_names are not strings see #8904 It looks like t_test and wald test ravel params incorrectly, should be "F" order. res.model.data.cov_names is raveled by columns ("F" order), i.e stacked by equation not by exog var (pr #6012) brief check `t_test(np.eye(...))` doe...
multi-index to string names Do we have a convention for combining equation names and exog names? ``` ['y{}_{}'.format(i[0], i[1]) for i in res2.model.data.cov_names] ['y1_logpopul', 'y1_selfLR', 'y1_age', 'y1_educ', 'y1_income', 'y1_const', 'y2_logpopul', 'y2_selfLR', 'y2_age', 'y2_educ', 'y2_...
2023-06-08T19:16:14Z
0.14
[ "statsmodels/discrete/tests/test_discrete.py::TestSweepAlphaL1::test_sweep_alpha", "statsmodels/discrete/tests/test_discrete.py::TestProbitPowell::test_pred_table", "statsmodels/discrete/tests/test_discrete.py::TestProbitPowell::test_resid_generalized", "statsmodels/discrete/tests/test_discrete.py::TestProbit...
[ "statsmodels/discrete/tests/test_discrete.py::test_mlogit_t_test" ]
Python
[]
[]
statsmodels/statsmodels
8,959
statsmodels__statsmodels-8959
[ "8936" ]
3b61c469ed8d4a6752b5bf01390789512f81f0c6
diff --git a/statsmodels/stats/weightstats.py b/statsmodels/stats/weightstats.py --- a/statsmodels/stats/weightstats.py +++ b/statsmodels/stats/weightstats.py @@ -1510,10 +1510,10 @@ def ztest( 'larger' : H1: difference in means larger than value 'smaller' : H1: difference in means smaller th...
diff --git a/statsmodels/stats/tests/test_weightstats.py b/statsmodels/stats/tests/test_weightstats.py --- a/statsmodels/stats/tests/test_weightstats.py +++ b/statsmodels/stats/tests/test_weightstats.py @@ -677,6 +677,45 @@ def test_ztest_ztost(): ztest_larger_mu_1s.method = 'One-sample z-Test' ztest_larger_mu_1s.dat...
two-sample ztest may have bug #### Describe the bug The implementation of the two sample ztest does not appear to match documented algorithms Specifically, the calculation of `var_pooled` below deviates slightly from how it is calculated elsewhere. https://github.com/statsmodels/statsmodels/blob/114d812133c0...
Hi @gorj-tessella, It seems there is a confusion between the z-test and the t-test. Your implementation aligns more with a t-test, considering the assumption of unequal variances. However, from my understanding, a z-test always assumes equal variances. Let me know if there is something I am missing. unequal variance w...
2023-07-20T14:02:19Z
0.14
[ "statsmodels/stats/tests/test_weightstats.py::TestSim1n::test_mean", "statsmodels/stats/tests/test_weightstats.py::TestSim1n::test_std", "statsmodels/stats/tests/test_weightstats.py::TestSim1n::test_sem", "statsmodels/stats/tests/test_weightstats.py::TestSim1n::test_quantiles", "statsmodels/stats/tests/test...
[ "statsmodels/stats/tests/test_weightstats.py::TestZTest::test" ]
Python
[]
[]
statsmodels/statsmodels
9,016
statsmodels__statsmodels-9016
[ "9015" ]
45a744de6c2d17bce6539d089d0f7426bc45630b
diff --git a/statsmodels/graphics/tsaplots.py b/statsmodels/graphics/tsaplots.py --- a/statsmodels/graphics/tsaplots.py +++ b/statsmodels/graphics/tsaplots.py @@ -17,7 +17,7 @@ def _prepare_data_corr_plot(x, lags, zero): if lags is None: # GH 4663 - use a sensible default value nobs = x.shape[0] ...
diff --git a/statsmodels/graphics/tests/test_tsaplots.py b/statsmodels/graphics/tests/test_tsaplots.py --- a/statsmodels/graphics/tests/test_tsaplots.py +++ b/statsmodels/graphics/tests/test_tsaplots.py @@ -375,3 +375,14 @@ def test_predict_plot(use_pandas, model_and_args, alpha): res = model(y, **kwargs).fit() ...
`plot_pacf` default `lags` raises with a small sample #### Describe the bug When the parameter `lags` is not specified in `statsmodels.graphics.tsaplots.plot_pacf`, the value which is computed by default causes the function to raise a `ValueError` due to `nlags` being more than 50% of the sample size. The limitat...
2023-10-02T10:18:54Z
0.14
[ "statsmodels/tsa/tests/test_stattools.py::TestADFNoConstant::test_critvalues", "statsmodels/tsa/tests/test_stattools.py::TestADFNoConstant::test_pvalue", "statsmodels/tsa/tests/test_stattools.py::TestADFNoConstant::test_teststat", "statsmodels/tsa/tests/test_stattools.py::test_adfuller_resid_variance_zero[x0]...
[ "statsmodels/tsa/tests/test_stattools.py::test_pacf_1_obs", "statsmodels/graphics/tests/test_tsaplots.py::test_plot_pacf_small_sample" ]
Python
[]
[]
statsmodels/statsmodels
9,130
statsmodels__statsmodels-9130
[ "9100", "9100" ]
a0eca865c65ef9336c6403f8ff4bc29a1d3ec26b
diff --git a/statsmodels/genmod/generalized_linear_model.py b/statsmodels/genmod/generalized_linear_model.py --- a/statsmodels/genmod/generalized_linear_model.py +++ b/statsmodels/genmod/generalized_linear_model.py @@ -41,6 +41,7 @@ cached_data, cached_value, ) +from statsmodels.tools.data import _as_array_w...
diff --git a/statsmodels/genmod/tests/test_glm.py b/statsmodels/genmod/tests/test_glm.py --- a/statsmodels/genmod/tests/test_glm.py +++ b/statsmodels/genmod/tests/test_glm.py @@ -2661,3 +2661,62 @@ def test_tweedie_score(): nhess = approx_hess_cs(pa, lambda x: model.loglike(x, scale=1)) ahess ...
Save the offset name in `GLM` and results wrapper #### Is your feature request related to a problem? Please describe Post model training, it is helpful to know which variable was used as the offset. This aids in post model analysis and deployment. The offset array is saved and can be accessed after saving the model...
I think currently `1.` is the only option. `2.` would be good but currently the extra arrays are not going through the endog/exog `model.data` handling (at least not in most cases. We could add a helper function that can be added to the `__init__` as replacement for np.asarray which does asarray plus return addition...
2024-01-24T22:24:28Z
0.14
[ "statsmodels/tools/tests/test_data.py::test_missing_data_pandas", "statsmodels/tools/tests/test_data.py::test_patsy_577", "statsmodels/tools/tests/test_data.py::test_dataframe", "statsmodels/genmod/tests/test_glm.py::TestTweedieSpecialLog0::test_resid", "statsmodels/genmod/tests/test_glm.py::TestTweedieSpec...
[ "statsmodels/tools/tests/test_data.py::test_as_array_with_name_array", "statsmodels/tools/tests/test_data.py::test_as_array_with_name_series", "statsmodels/genmod/tests/test_glm.py::test_names_default", "statsmodels/genmod/tests/test_glm.py::test_names" ]
Python
[]
[]
statsmodels/statsmodels
9,165
statsmodels__statsmodels-9165
[ "9162" ]
37bd2e421bad61bc54e8260b86a10a68d17892b3
diff --git a/statsmodels/tsa/statespace/mlemodel.py b/statsmodels/tsa/statespace/mlemodel.py --- a/statsmodels/tsa/statespace/mlemodel.py +++ b/statsmodels/tsa/statespace/mlemodel.py @@ -3644,6 +3644,10 @@ def simulate(self, nsimulations, measurement_shocks=None, if iloc > self.nobs: raise ValueEr...
diff --git a/statsmodels/tsa/arima/tests/test_model.py b/statsmodels/tsa/arima/tests/test_model.py --- a/statsmodels/tsa/arima/tests/test_model.py +++ b/statsmodels/tsa/arima/tests/test_model.py @@ -413,3 +413,22 @@ def test_hannan_rissanen_with_fixed_params(ar_order, ma_order, fixed_params): res = mod.fit(met...
`ARIMAResults.simulate` doesn't respect `random_state` #### Describe the bug The method `ARIMAResults.simulate` doesn't seem to respect the parameter `random_state`. It returns different results for a fixed random state parameter. #### Code Sample ```python from statsmodels.tsa.arima.model import ARIMA imp...
Thanks for reporting this. The problem appears to be that the `initial_state` is drawn without using the provided `random_state`: https://github.com/statsmodels/statsmodels/blob/main/statsmodels/tsa/statespace/mlemodel.py#L3648-L3656
2024-02-27T15:13:58Z
0.14
[ "statsmodels/tsa/arima/tests/test_model.py::test_append_with_exog", "statsmodels/tsa/arima/tests/test_model.py::test_hannan_rissanen_with_fixed_params[1-1-fixed_params1]", "statsmodels/tsa/arima/tests/test_model.py::test_hannan_rissanen_with_fixed_params[2-3-fixed_params2]", "statsmodels/tsa/arima/tests/test_...
[ "statsmodels/tsa/arima/tests/test_model.py::test_reproducible_simulation[7]", "statsmodels/tsa/arima/tests/test_model.py::test_reproducible_simulation[RandomState]", "statsmodels/tsa/arima/tests/test_model.py::test_reproducible_simulation[default_rng]" ]
Python
[]
[]
statsmodels/statsmodels
9,227
statsmodels__statsmodels-9227
[ "9233" ]
bc1899510adacebf1ec351e92a78b7421c17dbb0
diff --git a/statsmodels/robust/covariance.py b/statsmodels/robust/covariance.py --- a/statsmodels/robust/covariance.py +++ b/statsmodels/robust/covariance.py @@ -28,9 +28,15 @@ from scipy import stats, linalg from scipy.linalg.lapack import dtrtri from .scale import mad +import statsmodels.robust.norms as rnorms +i...
diff --git a/statsmodels/robust/tests/test_covariance.py b/statsmodels/robust/tests/test_covariance.py --- a/statsmodels/robust/tests/test_covariance.py +++ b/statsmodels/robust/tests/test_covariance.py @@ -6,6 +6,7 @@ import pandas as pd from statsmodels import robust +import statsmodels.robust.norms as robnorms ...
BUG: RLM fit with start_params raises if only one parameter if `start_params = np.array([5])` one element, 1-dim array, then the squeeze removes the 1-dim which then raises exception in shape check ``` statsmodels_gh\statsmodels\statsmodels\robust\robust_linear_model.py in fit(self, maxiter, tol, scale_est, init, c...
2024-04-22T15:56:21Z
0.14
[ "statsmodels/robust/tests/test_covariance.py::TestOGKTau::test", "statsmodels/robust/tests/test_covariance.py::TestOGKMad::test", "statsmodels/robust/tests/test_covariance.py::test_mahalanobis", "statsmodels/robust/tests/test_covariance.py::test_outliers_gy", "statsmodels/robust/tests/test_covariance.py::te...
[ "statsmodels/robust/tests/test_covariance.py::test_covdetmcd", "statsmodels/robust/tests/test_covariance.py::test_cov_ms", "statsmodels/robust/tests/test_covariance.py::test_covdetmm", "statsmodels/robust/tests/test_tools.py::test_eff[case5]", "statsmodels/robust/tests/test_tools.py::test_eff[case1]", "st...
Python
[]
[]
statsmodels/statsmodels
9,240
statsmodels__statsmodels-9240
[ "9121" ]
c22837f0632ae8890f56886460c429ebf356bd9b
diff --git a/statsmodels/stats/diagnostic.py b/statsmodels/stats/diagnostic.py --- a/statsmodels/stats/diagnostic.py +++ b/statsmodels/stats/diagnostic.py @@ -237,8 +237,9 @@ def compare_j(results_x, results_z, store=False): return tstat, pval +@deprecate_kwarg("cov_kwargs", "cov_kwds") def compare_encompassi...
diff --git a/statsmodels/stats/tests/test_diagnostic.py b/statsmodels/stats/tests/test_diagnostic.py --- a/statsmodels/stats/tests/test_diagnostic.py +++ b/statsmodels/stats/tests/test_diagnostic.py @@ -1805,8 +1805,8 @@ def test_encompasing_error(reset_randomstate): @pytest.mark.parametrize( "cov", [ - ...
linear_reset can't be set with "HAC" and maxlags, KeyErrors #### Describe the bug Hello, thanks for your time. We've tried several things but it still doesn't work even with the newest version of Statsmodels. We think this might be a bug. Issue is: we were trying to use "statsmodels.stats.diagnostic.linear_reset" with...
**update** this does not apply here, new issue #9122 robust cov_type is not implemented for, AFAIR, any of the diagnostic and specification tests. Main reason: When I implemented those I only had references (and other packages for unit tests) for the standard version with basic OLS in the auxiliary regression. ...
2024-05-07T10:01:51Z
0.14
[ "statsmodels/tsa/tests/test_seasonal.py::TestDecompose::test_ndarray", "statsmodels/tsa/tests/test_seasonal.py::TestDecompose::test_raises", "statsmodels/tsa/tests/test_seasonal.py::TestDecompose::test_pandas", "statsmodels/tsa/tests/test_seasonal.py::TestDecompose::test_2d", "statsmodels/tsa/tests/test_sea...
[ "statsmodels/stats/tests/test_diagnostic.py::test_deprecated_argument", "statsmodels/stats/tests/test_diagnostic.py::test_reset_smoke[cov0-False-princomp-2]", "statsmodels/stats/tests/test_diagnostic.py::test_reset_smoke[cov1-False-princomp-3]", "statsmodels/stats/tests/test_diagnostic.py::test_reset_smoke[co...
Python
[]
[]
statsmodels/statsmodels
9,249
statsmodels__statsmodels-9249
[ "9239" ]
85fef91bdbde9c90be0055fb712459f6860861f8
diff --git a/statsmodels/stats/proportion.py b/statsmodels/stats/proportion.py --- a/statsmodels/stats/proportion.py +++ b/statsmodels/stats/proportion.py @@ -108,7 +108,7 @@ def _bisection_search_conservative( return best_pt, best -def proportion_confint(count, nobs, alpha:float=0.05, method="normal"): +def p...
diff --git a/statsmodels/stats/tests/test_proportion.py b/statsmodels/stats/tests/test_proportion.py --- a/statsmodels/stats/tests/test_proportion.py +++ b/statsmodels/stats/tests/test_proportion.py @@ -995,3 +995,67 @@ def test_ci_symmetry_array(count, method): a = proportion_confint([count, count], n, method=met...
ENH: proportion_confint only has two-sided confidence intervals, no "alternative" option see https://stats.stackexchange.com/questions/646445/multinomial-one-sided-confidence-intervals same for multinomial_proportions_confint I think for proportion_confint it should be just one interval at 2*alpha, except for "b...
@josef-pkt Hi, Josef. I read the thread and agree that the one-sided interval is the same as one side of the two-sided interval for doubled alpha in a binomial distribution. Can I take this issue on propotion_confint to add an option to explicitly get one-sided ci? Yes, we want to add the `alternative` option and i...
2024-05-19T14:51:31Z
0.14
[ "statsmodels/stats/tests/test_proportion.py::TestProportion::test_number_pairs_1493", "statsmodels/stats/tests/test_proportion.py::TestProportion::test_scalar", "statsmodels/stats/tests/test_proportion.py::TestProportion::test_pairwiseproptest", "statsmodels/stats/tests/test_proportion.py::TestProportion::tes...
[ "statsmodels/stats/tests/test_proportion.py::test_proportion_confint[jeffreys-0.05-two-sided-expected6-200-100]", "statsmodels/stats/tests/test_proportion.py::test_proportion_confint[beta-0.05-larger-expected9-200-100]", "statsmodels/stats/tests/test_proportion.py::test_proportion_confint_binom_test[0.01-larger...
Python
[]
[]
statsmodels/statsmodels
9,255
statsmodels__statsmodels-9255
[ "9254" ]
bf91082711ce95a5bbca557c4d9ab79afb990dbd
diff --git a/statsmodels/stats/rates.py b/statsmodels/stats/rates.py --- a/statsmodels/stats/rates.py +++ b/statsmodels/stats/rates.py @@ -186,15 +186,15 @@ def test_poisson(count, nobs, value, method=None, alternative="two-sided", return res -def confint_poisson(count, exposure, method=None, alpha=0.05): +def...
diff --git a/statsmodels/stats/tests/test_rates_poisson.py b/statsmodels/stats/tests/test_rates_poisson.py --- a/statsmodels/stats/tests/test_rates_poisson.py +++ b/statsmodels/stats/tests/test_rates_poisson.py @@ -1146,3 +1146,24 @@ def test_power_negbin(): assert_allclose(pow_p, pow1, atol=5e-2) assert_al...
ENH: confint_poisson only has two-sided confidence intervals https://www.statsmodels.org/dev/generated/statsmodels.stats.rates.confint_poisson.html confint_poisson does not have an one-sided confidence interval option. As mentioned in #9249, add a new option 'alternative' to confint_poisson. Maybe same for multi...
for docstrings: I will come up with a short explanation for the meaning and direction of alternative option for confidence intervals. Then, we can copy it to all confint functions that have the alternative keyword. one sided confint for multinomial_proportions_confint will, most likely, not be obvious and we might ...
2024-05-26T00:37:06Z
0.14
[ "statsmodels/stats/tests/test_rates_poisson.py::TestMethodsCompare2indep::test_test[diff-score]", "statsmodels/stats/tests/test_rates_poisson.py::TestMethodsCompare2indep::test_test_vectorized[ratio-exact-cond]", "statsmodels/stats/tests/test_rates_poisson.py::TestMethodsCompare2indep::test_confint[diff-wald]",...
[ "statsmodels/stats/tests/test_rates_poisson.py::test_confint_poisson_alternative[larger-score-0.01-1000-10]", "statsmodels/stats/tests/test_rates_poisson.py::test_confint_poisson_alternative[larger-sqrt-0.1-1000-1]", "statsmodels/stats/tests/test_rates_poisson.py::test_confint_poisson_alternative[smaller-sqrt-v...
Python
[]
[]
statsmodels/statsmodels
9,280
statsmodels__statsmodels-9280
[ "9191" ]
52edda81159e557dd845cc97a8a9324915c69792
diff --git a/statsmodels/iolib/summary2.py b/statsmodels/iolib/summary2.py --- a/statsmodels/iolib/summary2.py +++ b/statsmodels/iolib/summary2.py @@ -471,7 +471,8 @@ def _make_unique(list_of_names): def summary_col(results, float_format='%.4f', model_names=(), stars=False, info_dict=None, regressor...
diff --git a/statsmodels/iolib/tests/test_summary2.py b/statsmodels/iolib/tests/test_summary2.py --- a/statsmodels/iolib/tests/test_summary2.py +++ b/statsmodels/iolib/tests/test_summary2.py @@ -168,6 +168,72 @@ def test_OLSsummary(self): result = string_to_find in actual assert (result is True) + ...
ENH: Add optional parameters for summary_col to indicate FEs Researchers tend to show they used categorical variables without all the coefficients, saying whether they included a fixed effect. This PR adds that feature. ### Example ```python import numpy as np import pandas as pd import seaborn as sns import st...
2024-06-14T15:39:28Z
0.14
[ "statsmodels/iolib/tests/test_summary2.py::TestSummaryLatex::test_summary_col_ordering_preserved", "statsmodels/iolib/tests/test_summary2.py::TestSummaryLatex::test_summarycol", "statsmodels/iolib/tests/test_summary2.py::TestSummaryLatex::test__repr_latex_", "statsmodels/iolib/tests/test_summary2.py::TestSumm...
[ "statsmodels/iolib/tests/test_summary2.py::TestSummaryLatex::test_summarycol_fixed_effects" ]
Python
[]
[]
redis/redis-py
1,741
redis__redis-py-1741
[ "1254" ]
f82ab336c3e249ee871ee5e50e10c0de08c4f38a
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -637,6 +637,31 @@ def flushdb(self, asynchronous=False, **kwargs): args.append(b"ASYNC") return self.execute_command("FLUSHDB", *args, **kwargs) + def sync(self): + ...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -4151,6 +4151,18 @@ def test_replicaof(self, r): assert r.replicaof("NO ONE") assert r.replicaof("NO", "ONE") + @skip_if_server_version_lt("2.8.0") + def test_sync(self...
running dump() fails when decode_responses=True redis-py 3.3.6 python 3.6.9 Ubuntu 18.04 redis 4.0.9 I have a `Redis` instance that I created with `decode_responses=True`. When I run `.dump(key)` the decoder fails to decode the bytes response, which makes sense, because it isn't unicode. ``` File "/home/bri...
Hello, I have an issue too on decode_responses. UTF8 decoding for sentinel part seems not working : ``` self.master = self.sentinel.master_for(redis_sentinels_master, socket_timeout=socket_db_timeout, db=db, encoding=u'utf-8', decode_responses=True) ``` ``` print(self.master.get(myKey)) b'xyz' ``` I...
2021-11-23T09:17:35Z
4.1
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_commands.py::TestRedisCommands::test_acl_cat_no_category", ...
[ "tests/test_commands.py::TestRedisCommands::test_sync", "tests/test_commands.py::TestRedisCommands::test_psync" ]
Python
[]
[]
redis/redis-py
1,817
redis__redis-py-1817
[ "1764" ]
18c6809b761bc6755349e1d7e08e74e857ec2c65
diff --git a/redis/client.py b/redis/client.py --- a/redis/client.py +++ b/redis/client.py @@ -868,6 +868,7 @@ def __init__( errors=None, decode_responses=False, retry_on_timeout=False, + retry_on_error=[], ssl=False, ssl_keyfile=None, ssl_certfile=None, @@ -...
diff --git a/tests/test_retry.py b/tests/test_retry.py --- a/tests/test_retry.py +++ b/tests/test_retry.py @@ -1,10 +1,20 @@ +from unittest.mock import patch + import pytest from redis.backoff import NoBackoff +from redis.client import Redis from redis.connection import Connection, UnixDomainSocketConnection -from...
Getting ReadOnly error when writing data to AWS elastic cache while the cluster is vertically scaled I have a python application that writes some data to AWS elastic cache cluster at a regular interval. Here's an example script that simulates the functionality of my application. It also replicates the error that I h...
@Akshit8 This looks like an issue in ElastiCache as opposed to redis-py. Would you mind having a look at redis-py 4? This a release back - and to be honest, I'd expect the same behaviour. If you're feeling particularly testworthy I'd *love* a hand testing the cluster code we pulled in from @barshaul in redis-py 4.1....
2021-12-18T12:14:28Z
4.1
[ "tests/test_retry.py::TestConnectionConstructorWithRetry::test_retry_on_timeout_boolean[Connection-False]", "tests/test_retry.py::TestConnectionConstructorWithRetry::test_retry_on_timeout_boolean[Connection-True]", "tests/test_retry.py::TestConnectionConstructorWithRetry::test_retry_on_timeout_boolean[UnixDomai...
[ "tests/test_retry.py::TestConnectionConstructorWithRetry::test_retry_on_error[Connection]", "tests/test_retry.py::TestConnectionConstructorWithRetry::test_retry_on_error[UnixDomainSocketConnection]", "tests/test_retry.py::TestConnectionConstructorWithRetry::test_retry_on_error_empty_value[Connection]", "tests...
Python
[]
[]
redis/redis-py
1,858
redis__redis-py-1858
[ "1809" ]
9442d34beb8254aebe87b9b48ef7e627e1079837
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -2224,6 +2224,39 @@ def sort( options = {"groups": len(get) if groups else None} return self.execute_command("SORT", *pieces, **options) + def sort_ro( + self, + ...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -2700,6 +2700,16 @@ def test_sort_all_options(self, r): assert num == 4 assert r.lrange("sorted", 0, 10) == [b"vodka", b"milk", b"gin", b"apple juice"] + @skip_if_server_versi...
Add support for SORT_RO
2022-01-05T10:56:52Z
4.1
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_commands.py::TestRedisCommands::test_acl_cat_no_category", ...
[ "tests/test_commands.py::TestRedisCommands::test_sort_ro" ]
Python
[]
[]
redis/redis-py
1,860
redis__redis-py-1860
[ "1806" ]
c4e408880c0fbfe714cd9ad4e1e6b908f00be9b5
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1514,6 +1514,15 @@ def expireat(self, name: KeyT, when: AbsExpiryT) -> ResponseT: when = int(time.mktime(when.timetuple())) return self.execute_command("EXPIREAT", name, when)...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1075,6 +1075,12 @@ def test_expireat_unixtime(self, r): assert r.expireat("a", expire_at_seconds) is True assert 0 < r.ttl("a") <= 61 + @skip_if_server_version_lt("7.0.0") + ...
Add support for EXPIRETIME
2022-01-05T11:00:10Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_expiretime" ]
Python
[]
[]
redis/redis-py
1,861
redis__redis-py-1861
[ "1807" ]
c4e408880c0fbfe714cd9ad4e1e6b908f00be9b5
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1782,6 +1782,15 @@ def pexpireat(self, name: KeyT, when: AbsExpiryT) -> ResponseT: when = int(time.mktime(when.timetuple())) * 1000 + ms return self.execute_command("PEXPIREAT...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1248,6 +1248,12 @@ def test_pexpireat_unixtime(self, r): assert r.pexpireat("a", expire_at_seconds) is True assert 0 < r.pttl("a") <= 61000 + @skip_if_server_version_lt("7.0....
Add support for PEXPIRETIME
2022-01-05T11:01:42Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_pexpiretime" ]
Python
[]
[]
redis/redis-py
1,895
redis__redis-py-1895
[ "1833" ]
7d23974a62982d1b4b5586a648f8e7b17eccc6e5
diff --git a/redis/connection.py b/redis/connection.py --- a/redis/connection.py +++ b/redis/connection.py @@ -604,7 +604,9 @@ def connect(self): if self._sock: return try: - sock = self._connect() + sock = self.retry.call_with_retry( + lambda: self._c...
diff --git a/tests/test_connection.py b/tests/test_connection.py --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1,10 +1,14 @@ +import socket import types from unittest import mock +from unittest.mock import patch import pytest +from redis.backoff import NoBackoff from redis.connection import ...
Question: resolving hostname when retry on connection timeout I wonder if Redis client resolve again the hostname if connection timeout occurred while setting `retry_on_timeout=True`. I'm asking since sometime the mapping between hostname to ip can be invalid since the DNS changed the mapping.
Yes, By setting retry_on_timeout=True, when timeoutError is thrown, the client disconnects its current connection and creates a new one. Upon creating a new connection, the hostname is resolved again. To retry on other errors too, you can use the new argument `retry_on_error` and pass other error types in a list. ...
2022-01-23T18:03:50Z
4.1
[ "tests/test_connection.py::test_loading_external_modules", "tests/test_connection.py::TestConnection::test_disconnect", "tests/test_connection.py::TestConnection::test_disconnect__shutdown_OSError", "tests/test_connection.py::TestConnection::test_disconnect__close_OSError", "tests/test_connection.py::TestCo...
[ "tests/test_connection.py::TestConnection::test_retry_connect_on_timeout_error" ]
Python
[]
[]
redis/redis-py
2,027
redis__redis-py-2027
[ "1939" ]
8d949a3f39bc6fe17ee90009e78f17b32f69899a
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1787,18 +1787,41 @@ def pexpire(self, name: KeyT, time: ExpiryT) -> ResponseT: time = int(time.total_seconds() * 1000) return self.execute_command("PEXPIRE", name, time) - ...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1254,6 +1254,41 @@ def test_pexpireat_unixtime(self, r): assert r.pexpireat("a", expire_at_seconds) is True assert 0 < r.pttl("a") <= 61000 + @skip_if_server_version_lt("7.0....
Add support for PEXPIREAT redis-7 options [NX|XX|GT|LT]
2022-02-27T21:12:34Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_pexpireat_option_nx", "tests/test_commands.py::TestRedisCommands::test_pexpireat_option_xx", "tests/test_commands.py::TestRedisCommands::test_pexpireat_option_gt", "tests/test_commands.py::TestRedisCommands::test_pexpireat_option_lt" ]
Python
[]
[]
redis/redis-py
2,068
redis__redis-py-2068
[ "1967" ]
876cafc56ff465af5639a92ea18625f49de47563
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1363,6 +1363,7 @@ def bitcount( key: KeyT, start: Union[int, None] = None, end: Union[int, None] = None, + mode: Optional[str] = None, ) -> ResponseT: ...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -854,6 +854,15 @@ def test_bitcount(self, r): assert r.bitcount("a", -2, -1) == 2 assert r.bitcount("a", 1, 1) == 1 + @skip_if_server_version_lt("7.0.0") + def test_bitcoun...
Add support for missing command BITPOS - [BYTE|BIT] field
2022-03-28T12:36:25Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_bitcount_mode", "tests/test_commands.py::TestRedisCommands::test_bitpos_mode" ]
Python
[]
[]
redis/redis-py
2,142
redis__redis-py-2142
[ "2121" ]
2da2ac3368bc88ad909d78fe73029bc9c627545d
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -760,13 +760,15 @@ def command_docs(self, *args): "COMMAND DOCS is intentionally not implemented in the client." ) - def config_get(self, pattern: PatternT = "*", **kwargs...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -669,6 +669,12 @@ def test_config_get(self, r): # # assert 'maxmemory' in data # assert data['maxmemory'].isdigit() + @skip_if_server_version_lt("7.0.0") + def test_config_...
CONFIG GET - add the ability to pass multiple pattern parameters in one call
2022-04-26T13:38:36Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_config_get_multi_params" ]
Python
[]
[]
redis/redis-py
2,143
redis__redis-py-2143
[ "2122" ]
2d8b90139710240d172e16f1a60b2cd847a0802c
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -770,12 +770,18 @@ def config_get( """ return self.execute_command("CONFIG GET", pattern, *args, **kwargs) - def config_set(self, name: KeyT, value: EncodableT, **kwargs) -> R...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -692,6 +692,16 @@ def test_config_set(self, r): assert r.config_set("timeout", 0) assert r.config_get()["timeout"] == "0" + @skip_if_server_version_lt("7.0.0") + @skip_if_r...
CONFIG SET - add the ability to set multiple parameters in one call
2022-04-26T14:41:23Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_config_set_multi_params" ]
Python
[]
[]
redis/redis-py
2,145
redis__redis-py-2145
[ "2123" ]
c198612a3ed67d78d7964b0253e96b3fa1d7d707
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -900,7 +900,9 @@ def select(self, index: int, **kwargs) -> ResponseT: """ return self.execute_command("SELECT", index, **kwargs) - def info(self, section: Union[str, None] = N...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -727,6 +727,14 @@ def test_info(self, r): assert "arch_bits" in info.keys() assert "redis_version" in info.keys() + @pytest.mark.onlynoncluster + @skip_if_server_version_lt...
INFO - add support for taking multiple section arguments
2022-04-27T10:16:56Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_info_multi_sections" ]
Python
[]
[]
redis/redis-py
2,146
redis__redis-py-2146
[ "2125" ]
a696fe5e3155238fd8e9ec65224f94f6f25bb72b
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -5592,6 +5592,27 @@ def module_load(self, path, *args) -> ResponseT: """ return self.execute_command("MODULE LOAD", path, *args) + def module_loadex( + self, + p...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -4513,6 +4513,18 @@ def test_module(self, r): r.module_load("/some/fake/path", "arg1", "arg2", "arg3", "arg4") assert "Error loading the extension." in str(excinfo.value) ...
Add support for MODULE LOADEX
2022-04-27T10:57:48Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_module_loadex" ]
Python
[]
[]
redis/redis-py
2,147
redis__redis-py-2147
[ "2124" ]
6ba46418236718d95f9dee09adaa8a42a4d5c23b
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1044,6 +1044,15 @@ def memory_purge(self, **kwargs) -> ResponseT: """ return self.execute_command("MEMORY PURGE", **kwargs) + def latency_histogram(self, *args): + """...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -4420,6 +4420,11 @@ def test_memory_usage(self, r): r.set("foo", "bar") assert isinstance(r.memory_usage("foo"), int) + @skip_if_server_version_lt("7.0.0") + def test_laten...
Add support for LATENCY HISTOGRAM
2022-04-27T11:25:33Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_latency_histogram_not_implemented" ]
Python
[]
[]
redis/redis-py
2,157
redis__redis-py-2157
[ "2136" ]
fdb9075745060e7a3633248fa6f419e895f010b7
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -3505,6 +3505,7 @@ def xgroup_create( groupname: GroupT, id: StreamIdT = "$", mkstream: bool = False, + entries_read: Optional[int] = None, ) -> ResponseT: ...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -3735,6 +3735,13 @@ def test_xadd_minlen_and_limit(self, r): r.xadd(stream, {"foo": "bar"}) assert r.xadd(stream, {"foo": "bar"}, approximate=True, minid=m3) + @skip_if_server...
XINFO STREAM - add the `max-deleted-entry-id`, `entries-added`, `recorded-first-entry-id`, `entries-read` and `lag` fields
2022-05-01T13:21:17Z
4.2
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_xgroup_create_entriesread", "tests/test_commands.py::TestRedisCommands::test_xgroup_setid" ]
Python
[]
[]
redis/redis-py
2,329
redis__redis-py-2329
[ "2325" ]
2cea637b2e936265d2001043d2b2d4e62559dc17
diff --git a/redis/asyncio/connection.py b/redis/asyncio/connection.py --- a/redis/asyncio/connection.py +++ b/redis/asyncio/connection.py @@ -87,6 +87,15 @@ class _Sentinel(enum.Enum): "exports one or more module-side data " "types, can't unload" ) +# user send an AUTH cmd to a server without authorization ...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -68,6 +68,14 @@ def test_case_insensitive_command_names(self, r): class TestRedisCommands: @skip_if_redis_enterprise() def test_auth(self, r, request): + # sending an AUTH command ...
WRONGPASS response doesn't raise AuthenticationError exception **Version**: What redis-py and what redis version is the issue happening on? redis-py 4.3.4 redis 6.3.6 **Platform**: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure) python 3.9 on macOS Monterey 12.0.1 **...
2022-08-09T17:15:44Z
4.4
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_commands.py::TestRedisCommands::test_acl_cat_no_category", ...
[ "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_connection_pool.py::TestConnection::test_connect_no_auth_configured", "tests/test_connection_pool.py::TestConnection::test_connect_invalid_auth_credentials_supplied" ]
Python
[]
[]
redis/redis-py
2,340
redis__redis-py-2340
[ "1966" ]
771109e74feb3b8f630c047bf4f93da2800ec22e
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1504,6 +1504,29 @@ def bitfield( """ return BitFieldOperation(self, key, default_overflow=default_overflow) + def bitfield_ro( + self: Union["Redis", "AsyncRedis"], + ...
diff --git a/tests/test_asyncio/test_commands.py b/tests/test_asyncio/test_commands.py --- a/tests/test_asyncio/test_commands.py +++ b/tests/test_asyncio/test_commands.py @@ -2953,6 +2953,19 @@ async def test_bitfield_operations(self, r: redis.Redis): ) assert resp == [0, None, 255] + @skip_if_se...
Add support for missing command BITFIELD_RO
2022-08-16T17:13:22Z
4.4
[ "tests/test_asyncio/test_commands.py::TestResponseCallbacks::test_response_callbacks[single-python-parser]", "tests/test_asyncio/test_commands.py::TestResponseCallbacks::test_response_callbacks[pool-python-parser]", "tests/test_asyncio/test_commands.py::TestResponseCallbacks::test_response_callbacks[single-hire...
[ "tests/test_asyncio/test_commands.py::TestRedisCommands::test_bitfield_ro[single-python-parser]", "tests/test_asyncio/test_commands.py::TestRedisCommands::test_bitfield_ro[pool-python-parser]", "tests/test_asyncio/test_commands.py::TestRedisCommands::test_bitfield_ro[single-hiredis]", "tests/test_asyncio/test...
Python
[]
[]
redis/redis-py
2,501
redis__redis-py-2501
[ "1977" ]
6219574b042a6596b150ca8248441198f01f8c87
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -980,6 +980,34 @@ def lastsave(self, **kwargs) -> ResponseT: """ return self.execute_command("LASTSAVE", **kwargs) + def latency_doctor(self): + """Raise a NotImplement...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -4527,6 +4527,16 @@ def test_latency_histogram_not_implemented(self, r: redis.Redis): with pytest.raises(NotImplementedError): r.latency_histogram() + @skip_if_server_vers...
Add support for missing command LATENCY DOCTOR
2022-12-11T07:25:13Z
4.4
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_latency_graph_not_implemented", "tests/test_commands.py::TestRedisCommands::test_latency_doctor_not_implemented" ]
Python
[]
[]
redis/redis-py
2,503
redis__redis-py-2503
[ "1982" ]
3a121bef7bbc5bb5f07b119b0eef2f7527a38eda
diff --git a/redis/cluster.py b/redis/cluster.py --- a/redis/cluster.py +++ b/redis/cluster.py @@ -265,6 +265,9 @@ class AbstractRedisCluster: "READWRITE", "TIME", "GRAPH.CONFIG", + "LATENCY HISTORY", + "LATENCY LATEST", + "...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -4527,16 +4527,23 @@ def test_latency_histogram_not_implemented(self, r: redis.Redis): with pytest.raises(NotImplementedError): r.latency_histogram() - @skip_if_server_ver...
Add support for missing command LATENCY RESET
2022-12-12T12:53:19Z
4.4
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_latency_history", "tests/test_commands.py::TestRedisCommands::test_latency_latest", "tests/test_commands.py::TestRedisCommands::test_latency_reset" ]
Python
[]
[]
redis/redis-py
2,529
redis__redis-py-2529
[ "2178" ]
f06f3db647c81bc24fa9bdad33822ca6175c32eb
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -2255,6 +2255,8 @@ def set( pieces.append(int(ex.total_seconds())) elif isinstance(ex, int): pieces.append(ex) + elif isinstance(ex, str) an...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1600,6 +1600,13 @@ def test_set_ex(self, r): with pytest.raises(exceptions.DataError): assert r.set("a", "1", ex=10.0) + @skip_if_server_version_lt("2.6.0") + def test...
`set` and `expire` api diffrent handle to 'expire time' param expire: https://github.com/redis/redis-py/blob/42b937fa1f73f3e8251eba5ec8ead2fcbaec7c50/redis/commands/core.py#L1592 set: https://github.com/redis/redis-py/blob/42b937fa1f73f3e8251eba5ec8ead2fcbaec7c50/redis/commands/core.py#L2175 The `set` api `ex` s...
2022-12-22T13:09:56Z
4.4
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_set_ex_str" ]
Python
[]
[]
redis/redis-py
2,583
redis__redis-py-2583
[ "2581" ]
5cb5712d283fa8fb300abc9d71a61c1a81de5643
diff --git a/redis/connection.py b/redis/connection.py --- a/redis/connection.py +++ b/redis/connection.py @@ -1153,6 +1153,7 @@ def __init__( retry=None, redis_connect_func=None, credential_provider: Optional[CredentialProvider] = None, + command_packer=None, ): """ ...
diff --git a/tests/test_connection.py b/tests/test_connection.py --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -7,7 +7,13 @@ import redis from redis.backoff import NoBackoff -from redis.connection import Connection, HiredisParser, PythonParser +from redis.connection import ( + Connection, + ...
'UnixDomainSocketConnection' object has no attribute '_command_packer' **Version**: v4.5.0 **Platform**: Debian Bullseye using Python v3.9.2 **Description**: The following code which used to work on up to and including v4.4.2 now crashes with the stack trace below on v4.5.0. ```python redis_conn = redis.Red...
also seeing this in our apps, had to pin to 4.4.2 to prevent our django app from crashing anytime it attempted to use the cache I guess this is the issue: ```python class Connection: def __init__(self, ...): ... self._command_packer = self._construct_command_packer(command_packer) class SS...
2023-02-08T04:03:44Z
4.5
[ "tests/test_connection.py::test_loading_external_modules", "tests/test_connection.py::TestConnection::test_disconnect", "tests/test_connection.py::TestConnection::test_disconnect__shutdown_OSError", "tests/test_connection.py::TestConnection::test_disconnect__close_OSError", "tests/test_connection.py::TestCo...
[ "tests/test_connection.py::test_pack_command[UnixDomainSocketConnection]" ]
Python
[]
[]
redis/redis-py
2,628
redis__redis-py-2628
[ "2609" ]
318b114f4da9846a2a7c150e1fb702e9bebd9fdf
diff --git a/redis/client.py b/redis/client.py --- a/redis/client.py +++ b/redis/client.py @@ -518,10 +518,13 @@ def parse_geosearch_generic(response, **options): Parse the response of 'GEOSEARCH', GEORADIUS' and 'GEORADIUSBYMEMBER' commands according to 'withdist', 'withhash' and 'withcoord' labels. """...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -3508,6 +3508,12 @@ def test_geosearchstore_dist(self, r): # instead of save the geo score, the distance is saved. assert r.zscore("places_barcelona", "place1") == 88.0506069840930...
Geo search functions don't work with execute_command **Version**: What redis-py and what redis version is the issue happening on? * `redis-py==4.5.1` * `redis` docker image `redis:5.0.6` **Platform**: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure) Linux, `python:3.8-slim-...
2023-03-19T16:01:21Z
4.5
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_georadius_Issue2609" ]
Python
[]
[]
redis/redis-py
2,732
redis__redis-py-2732
[ "2677" ]
bf528fc7f776ce8e926b2e9abfa4e2460d73baa4
diff --git a/redis/client.py b/redis/client.py --- a/redis/client.py +++ b/redis/client.py @@ -420,9 +420,13 @@ def parse_item(item): # an O(N) complexity) instead of the command. if isinstance(item[3], list): result["command"] = space.join(item[3]) + result["client_address"] =...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -861,6 +861,8 @@ def test_slowlog_get(self, r, slowlog): # make sure other attributes are typed correctly assert isinstance(slowlog[0]["start_time"], int) assert isinstanc...
slowlog_get() return value count less than Redis Doc mentioned and redis-cli returned. Thanks for wanting to report an issue you've found in redis-py. Please delete this text and fill in the template below. It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to h...
[This](https://github.com/redis/redis-py/blob/master/redis/client.py#L413) is where the response is parsed and needs to be updated to capture the missing fields.
2023-04-30T15:57:15Z
4.5
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_slowlog_get" ]
Python
[]
[]
redis/redis-py
2,745
redis__redis-py-2745
[ "2681" ]
3748a8b36d5c765f5d21c6d20b041fa1876021ae
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -761,6 +761,17 @@ def client_no_evict(self, mode: str) -> Union[Awaitable[str], str]: """ return self.execute_command("CLIENT NO-EVICT", mode) + def client_no_touch(self, mode...
diff --git a/tests/test_asyncio/test_commands.py b/tests/test_asyncio/test_commands.py --- a/tests/test_asyncio/test_commands.py +++ b/tests/test_asyncio/test_commands.py @@ -446,6 +446,14 @@ async def test_client_pause(self, r: redis.Redis): with pytest.raises(exceptions.RedisError): await r.clie...
Add support for new redis command CLIENT NO-TOUCH 7.2.0 adds support for the new redis command CLIENT NO-TOUCH. We need to add support, documented [here](https://redis.io/commands/CLIENT-NO-TOUCH).
2023-05-04T15:05:26Z
4.5
[ "tests/test_asyncio/test_commands.py::TestResponseCallbacks::test_response_callbacks[single-python-parser]", "tests/test_asyncio/test_commands.py::TestResponseCallbacks::test_response_callbacks[pool-python-parser]", "tests/test_asyncio/test_commands.py::TestResponseCallbacks::test_response_callbacks[single-hire...
[ "tests/test_asyncio/test_commands.py::TestRedisCommands::test_client_no_touch[single-python-parser]", "tests/test_asyncio/test_commands.py::TestRedisCommands::test_client_no_touch[pool-python-parser]", "tests/test_asyncio/test_commands.py::TestRedisCommands::test_client_no_touch[single-hiredis]", "tests/test_...
Python
[]
[]
redis/redis-py
2,752
redis__redis-py-2752
[ "2638" ]
cfdcfd87acdc10bedba6230b0cbe7dcf44b4652a
diff --git a/redis/asyncio/client.py b/redis/asyncio/client.py --- a/redis/asyncio/client.py +++ b/redis/asyncio/client.py @@ -139,8 +139,12 @@ class initializer. In the case of conflicting arguments, querystring arguments always win. """ + single_connection_client = kwargs.pop("single_connec...
diff --git a/tests/test_asyncio/test_connection.py b/tests/test_asyncio/test_connection.py --- a/tests/test_asyncio/test_connection.py +++ b/tests/test_asyncio/test_connection.py @@ -271,3 +271,9 @@ async def open_connection(*args, **kwargs): vals = await asyncio.gather(do_read(), do_close()) assert vals ==...
Redis.from_url() is a misnomer **Version**: 4.5.2 **Platform**: Python 3.11.2 **Description**: Redis.from_url is a convenience function, but the kwargs are passed into the ConnectionPool object and not the Redis instance. This formerly wasn't a problem, but it appears as though auto_close_connection_pool now defa...
2023-05-08T08:29:13Z
4.5
[ "tests/test_asyncio/test_connection.py::test_invalid_response[single-python-parser]", "tests/test_asyncio/test_connection.py::test_invalid_response[pool-python-parser]", "tests/test_asyncio/test_connection.py::test_invalid_response[single-hiredis]", "tests/test_asyncio/test_connection.py::test_invalid_respons...
[ "tests/test_asyncio/test_connection.py::test_create_single_connection_client_from_url", "tests/test_connection.py::test_create_single_connection_client_from_url" ]
Python
[]
[]
redis/redis-py
2,913
redis__redis-py-2913
[ "2901" ]
509c77c5263188fad239b07c80ecc5b0e8372647
diff --git a/redis/asyncio/client.py b/redis/asyncio/client.py --- a/redis/asyncio/client.py +++ b/redis/asyncio/client.py @@ -114,7 +114,7 @@ def from_url( cls, url: str, single_connection_client: bool = False, - auto_close_connection_pool: bool = True, + auto_close_connection_...
diff --git a/tests/test_asyncio/test_connection.py b/tests/test_asyncio/test_connection.py --- a/tests/test_asyncio/test_connection.py +++ b/tests/test_asyncio/test_connection.py @@ -11,7 +11,7 @@ _AsyncRESP3Parser, _AsyncRESPBase, ) -from redis.asyncio import Redis +from redis.asyncio import ConnectionPool,...
`auto_close_connection_pool` ignored This defect pertains to issues discovered with #2831 In async mode, it is important that a `Redis` object which holds its own pool, can be told to close it when the `Redis` object is closed, to free the user from such hassles. Examples in the code include ``` python from red...
2023-08-24T16:02:09Z
5.0
[ "tests/test_asyncio/test_connection.py::test_invalid_response[single-python-parser]", "tests/test_asyncio/test_connection.py::test_invalid_response[pool-python-parser]", "tests/test_asyncio/test_connection.py::test_invalid_response[single-hiredis]", "tests/test_asyncio/test_connection.py::test_invalid_respons...
[ "tests/test_asyncio/test_connection.py::test_pool_from_url_deprecation", "tests/test_asyncio/test_connection.py::test_pool_auto_close_disable", "tests/test_asyncio/test_connection.py::test_redis_from_pool[from_url]", "tests/test_asyncio/test_connection.py::test_redis_from_pool[from_args]", "tests/test_async...
Python
[]
[]
redis/redis-py
2,984
redis__redis-py-2984
[ "2983" ]
5391c5fc39a2c9aaa1b2e5acc799b93444270b88
diff --git a/redis/asyncio/connection.py b/redis/asyncio/connection.py --- a/redis/asyncio/connection.py +++ b/redis/asyncio/connection.py @@ -861,6 +861,7 @@ def to_bool(value) -> Optional[bool]: "max_connections": int, "health_check_interval": int, "ssl_check_hostname": to_bool, + "t...
diff --git a/tests/test_asyncio/test_connection_pool.py b/tests/test_asyncio/test_connection_pool.py --- a/tests/test_asyncio/test_connection_pool.py +++ b/tests/test_asyncio/test_connection_pool.py @@ -454,6 +454,31 @@ def test_invalid_scheme_raises_error(self): ) +class TestBlockingConnectionPoolURLParsi...
Instantiating BlockingConnectionPool.from_url with timeout in query args fails **Version**: 5.0.1 **Platform**: All **Description**: Missing cast in URL_QUERY_ARGUMENT_PARSERS for "timeout" parameter causes a runtime TypeError When instantiating a BlockingConnectionPool from url with timeout query parameter, timeo...
2023-10-05T23:07:18Z
5.0
[ "tests/test_asyncio/test_connection_pool.py::TestRedisAutoReleaseConnectionPool::test_auto_disconnect_redis_created_pool[single-python-parser]", "tests/test_asyncio/test_connection_pool.py::TestRedisAutoReleaseConnectionPool::test_auto_disconnect_redis_created_pool[pool-python-parser]", "tests/test_asyncio/test...
[ "tests/test_asyncio/test_connection_pool.py::TestBlockingConnectionPoolURLParsing::test_extra_typed_querystring_options", "tests/test_asyncio/test_connection_pool.py::TestBlockingConnectionPoolURLParsing::test_invalid_extra_typed_querystring_options", "tests/test_connection_pool.py::TestBlockingConnectionPoolUR...
Python
[]
[]
redis/redis-py
3,062
redis__redis-py-3062
[ "3059" ]
e13356db9220de1196ca3b7d10a2de623cc15b69
diff --git a/redis/commands/core.py b/redis/commands/core.py --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -97,6 +97,7 @@ def acl_genpass(self, bits: Union[int, None] = None, **kwargs) -> ResponseT: b = int(bits) if b < 0 or b > 4096: raise ValueErro...
diff --git a/tests/test_commands.py b/tests/test_commands.py --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -201,8 +201,9 @@ def test_acl_genpass(self, r): r.acl_genpass(-5) r.acl_genpass(5555) - r.acl_genpass(555) + password = r.acl_genpass(555) assert i...
"bug" about acl_genpass method Thanks for wanting to report an issue you've found in redis-py. Please delete this text and fill in the template below. It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to have as much data as possible. Thank you! **Versio...
2023-12-03T01:28:27Z
5.1
[ "tests/test_commands.py::TestResponseCallbacks::test_response_callbacks", "tests/test_commands.py::TestResponseCallbacks::test_case_insensitive_command_names", "tests/test_commands.py::TestRedisCommands::test_auth", "tests/test_commands.py::TestRedisCommands::test_command_on_invalid_key_type", "tests/test_c...
[ "tests/test_commands.py::TestRedisCommands::test_acl_genpass" ]
Python
[]
[]
redis/redis-py
3,264
redis__redis-py-3264
[ "3262" ]
e71119de095bb01201665d57a1dc63230aa0606e
diff --git a/redis/_parsers/helpers.py b/redis/_parsers/helpers.py --- a/redis/_parsers/helpers.py +++ b/redis/_parsers/helpers.py @@ -38,7 +38,7 @@ def parse_info(response): response = str_if_bytes(response) def get_value(value): - if "," not in value or "=" not in value: + if "," not in valu...
diff --git a/tests/test_parsers/test_helpers.py b/tests/test_parsers/test_helpers.py new file mode 100644 --- /dev/null +++ b/tests/test_parsers/test_helpers.py @@ -0,0 +1,35 @@ +from redis._parsers.helpers import parse_info + + +def test_parse_info(): + info_output = """ +# Modules +module:name=search,ver=999999,ap...
Discrepancy in `INFO` response parsing **Version**: `5.0.0` **Description**: The code for parsing the `INFO` response is creating a discrepancy in the new RediSearch index field types field, e.g., `search_fields_text`. If there is more than one section to this field its corresponding value (e.g., `TEXT=1, SORTABLE=...
2024-06-05T10:10:12Z
5.0
[]
[ "tests/test_parsers/test_helpers.py::test_parse_info" ]
Python
[]
[]
redis/redis-py
3,265
redis__redis-py-3265
[ "3262" ]
0d47d6527a10fb70f8fcfdf8df69ae3b11ec92ef
diff --git a/redis/_parsers/helpers.py b/redis/_parsers/helpers.py --- a/redis/_parsers/helpers.py +++ b/redis/_parsers/helpers.py @@ -38,7 +38,7 @@ def parse_info(response): response = str_if_bytes(response) def get_value(value): - if "," not in value or "=" not in value: + if "," not in valu...
diff --git a/tests/test_parsers/test_helpers.py b/tests/test_parsers/test_helpers.py new file mode 100644 --- /dev/null +++ b/tests/test_parsers/test_helpers.py @@ -0,0 +1,35 @@ +from redis._parsers.helpers import parse_info + + +def test_parse_info(): + info_output = """ +# Modules +module:name=search,ver=999999,ap...
Discrepancy in `INFO` response parsing **Version**: `5.0.0` **Description**: The code for parsing the `INFO` response is creating a discrepancy in the new RediSearch index field types field, e.g., `search_fields_text`. If there is more than one section to this field its corresponding value (e.g., `TEXT=1, SORTABLE=...
2024-06-05T11:31:12Z
5.1
[]
[ "tests/test_parsers/test_helpers.py::test_parse_info" ]
Python
[]
[]
prettier/prettier
10,714
prettier__prettier-10714
[ "10709" ]
f8fff81005881441ffd1f9982b2b525dea413ea9
diff --git a/src/language-js/print/function-parameters.js b/src/language-js/print/function-parameters.js --- a/src/language-js/print/function-parameters.js +++ b/src/language-js/print/function-parameters.js @@ -26,6 +26,8 @@ import { locEnd } from "../loc.js"; import { ArgExpansionBailout } from "../../common/errors.j...
diff --git a/tests/format/flow/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap b/tests/format/flow/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/flow/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,152 @@ +// Jest Snapshot v1,...
Suboptimal additional indentation for decorated functions **Prettier 2.2.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEB6VACAvDjcAeAhgLYAOANnBgIzY70ONPMtMYA6U6GMAFlQDMIAJ2KEY8ACYYIAVxil5MgT14BLAM4yoVAO5ry5beQCeGchAgBrDAHNLkztzUrSwuBLVxhGAG4AmADog2k0MWQ04aQxCLTUYHndxLQFZKDAYNWgtPnEnTEJ3DCgSKI4...
Closely related: https://github.com/prettier/prettier/issues/6921 I don't believe there is a solution. In situations like this, the developer is willing to sacrifice the readability of a call to get less indentation. How can an algorithm guess this intention? For `it`, `describe`, and co this was solved by hardcodin...
2021-04-16T13:48:14Z
2.8
[]
[ "tests/format/typescript/last-argument-expansion/jsfmt.spec.js", "tests/format/flow/last-argument-expansion/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEB6VACAvDjcAeAhgLYAOANnBgIzY70ONPMtMYA6U6GMAFlQDMIAJ2KEY8ACYYIAVxil5MgT14BLAM4yoVAO5ry5beQCeGchAgBrDAHNLkztzUrSwuBLVxhGAG4AmADog2k0MWQ04aQxCLTUYHndxLQFZKDAYNWgtPnEnTEJ3DCgSKI4QSTgBNR12EAxJFwFvBATcqBk+by1JWSoYCAwAI1lbDABiagAGABZ-fwwAWnyMSKpeCVINJHRbeN5ZIcDIYlQ3D0zvM-...
prettier/prettier
11,487
prettier__prettier-11487
[ "11482" ]
f63e15d1cd37167984dc329a34fc050343e3a91b
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -550,6 +550,19 @@ function genericPrint(path, options, print) { continue; } + // Ignore SCSS @forward wildcard suffix...
diff --git a/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap b/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap @@ -29,6 +29,8 @@ singleQuote: true @forward "library" as ...
[scss] Wildcard syntax in `@forward` broken Using the latest prettier wildcard syntax is broken when using `@forward` pattern. It worked as desired in v2.3.2. **Prettier 2.4.0** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEABAZhATgdwIZYAmABAOQB0A9AA54wAWpxeAzsbQwLQBUA3ADpQM2fETJVIAG2xNWxKdh4...
Regression, thanks Due https://github.com/prettier/prettier/pull/11461 /cc @niksy
2021-09-10T06:54:29Z
2.5
[]
[ "tests/format/scss/quotes/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEABAZhATgdwIZYAmABAOQB0A9AA54wAWpxeAzsbQwLQBUA3ADpQM2fETJVIAG2xNWxKdh4ChmXARIVKcSXAC2CGLLba9BpYJAAaEBGowAltBbJQBLBBwAFAgmco8kvgAns7WAEZYeGAA1nAwAMp4+gAy9lBwyOgBLHDhkTFx8bRgaQDmyDBYAK65IHphcISEjcl4UKVVeKVwAGLYunQO7cggeFUwEFYg9DC6kgDq9PbwLMVw8b7L9gBuy0EjYCyhIGk5WDCeka...
prettier/prettier
11,515
prettier__prettier-11515
[ "10848" ]
9e1038c0eb080da5b049a8689f0b9c08830e8fe3
diff --git a/src/document/doc-utils.js b/src/document/doc-utils.js --- a/src/document/doc-utils.js +++ b/src/document/doc-utils.js @@ -401,6 +401,16 @@ function replaceTextEndOfLine(text, replacement = literalline) { return join(replacement, text.split("\n")).parts; } +function canBreakFn(doc) { + if (doc.type =...
diff --git a/tests/format/typescript/assignment/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/assignment/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/typescript/assignment/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/assignment/__snapshots__/jsfmt.spec.js.snap @@ -263,6 +263,150 @@...
The offset for React component body depends on component name length in v2.3 **Prettier 2.3.0** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLWcBOAzAhmOAAgFkBPAYQgFsAHaBGABUwhoGdDgAdKQwgDySEoAVyoAjLDwC+PHpChsYJCtTpQGQgEpx8MAHQA1CKgAmAMRFQwMVNEq16sADxkH6hs1ZsAfIQC8hAAUwAKE0gCUAX7cvIQKSoS4AYQibHA...
Just checked if the issue is present in pure JavaScript and could reproduce it too: [Playgound](https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEBZAngYQgFsAHaBLAXkwAphMAPTAXwEpNKA+TYAHSkyZIUDJgCGHTAFc0cAII1W-QQCc4MKSoEAeACYBLAG6cm1YA2YBucZOBjm2gPQHj-Zv37DReQqXKwAdX0YAAsANTgVXAAZaABzADkxInk5NPSMzKzsnMzJOkYAGkxcFn...
2021-09-13T01:18:16Z
2.5
[]
[ "tests/format/typescript/assignment/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLWcBOAzAhmOAAgFkBPAYQgFsAHaBGABUwhoGdDgAdKQwgDySEoAVyoAjLDwC+PHpChsYJCtTpQGQgEpx8MAHQA1CKgAmAMRFQwMVNEq16sADxkH6hs1ZsAfIQC8hAAUwAKE0gCUAX7cvIQKSoS4AYQibHAAgkERPHyYcDAimLzOpqgAbj78KcD80gDcSTW40s4A9GWVMnJQ6PA4+ERuak4wAExe7Jy5AkKiElJxpHNikpjdUPLQicOOGrBj2ro2RiYWVjZ2U...
prettier/prettier
11,593
prettier__prettier-11593
[ "10955" ]
20df210ddae98bf8a7631227d1fc0c8224f27f97
diff --git a/src/language-js/print/function.js b/src/language-js/print/function.js --- a/src/language-js/print/function.js +++ b/src/language-js/print/function.js @@ -252,13 +252,20 @@ function printArrowChain( const isAssignmentRhs = Boolean(args && args.assignmentLayout); const shouldPutBodyOnSeparateLine = ...
diff --git a/tests/format/js/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/arrows/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/arrows/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/arrows/__snapshots__/jsfmt.spec.js.snap @@ -3691,6 +3691,9 @@ foo(c, a => b) foo(c, a => b, d) foo(a => b, ...
Using compound expression with comma operator as return value of curried function **Prettier 2.3.0** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAzArlMTAXkwAoBDAJwHMBGAGkyuoCYBKYgPjI6O4poMmNdgB0oIeiAgAHGAEt0yUFUoQA7gAUqCNMhDkANuvIBPPVIBGlcmADWcGAGUZt+VGrIYlXHClwAW0s4ABMQ0IAZcg9ccmo4ADEISg...
In the input I didn't write the ending semi-colon, and I didn't configure prettier about this, so a semi-colon was added. This does not change anything on the issue. With or without semi-colon, the issue is the same. I tested the same code with prettier **2.2.1**, and there was no problem with this previous version. I...
2021-09-27T02:55:24Z
2.5
[]
[ "tests/format/js/arrows/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAzArlMTAXkwAoBDAJwHMBGAGkyuoCYBKYgPjI6O4poMmNdgB0oIeiAgAHGAEt0yUFUoQA7gAUqCNMhDkANuvIBPPVIBGlcmADWcGAGUZt+VGrIYlXHClwAW0s4ABMQ0IAZcg9ccmo4ADEISgDyGAUPfXJcGAhJEAALGADDAHUC+Xg0VzA4J11K+QA3StN9MDQLEHc0OEoYTRtqVORsI16pACs0AA8AIRt7RydyALgI9zhR8b8QaZmnd2pDOABFXAh4b...
prettier/prettier
11,637
prettier__prettier-11637
[ "11635" ]
5909f5b3f191a0a32f759e1f4378477d3b90e28e
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -74,6 +74,7 @@ const { isColorAdjusterFuncNode, lastLineHasInlineComment, isAtWordPlaceholderNode, + isConfigurationNode, } = require("...
diff --git a/tests/format/scss/configuration/__snapshots__/jsfmt.spec.js.snap b/tests/format/scss/configuration/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/scss/configuration/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,94 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +expor...
Weird wrapping for SCSS @use rules <!-- BEFORE SUBMITTING AN ISSUE: 1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experiencing, you do not ne...
hm, both looks good... I think the indent should not be there @alexander-akait But it is also inconsistent with the SCSS map wrapping which does not wrap the opening parentheses to the next line
2021-10-08T14:58:13Z
2.5
[]
[ "tests/format/scss/configuration/jsfmt.spec.js", "tests/format/scss/quotes/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEABArgZzgAgDpoBmAngDYDmAVgIYD0ARtdgTgO4CWMAFjgBR5QcQnABJC1ALbtSxALQTq7KEj4Dh6nACV09dgGsANGo1DNEehBgQjgkzkzFM8CbPTsbd+9SiZZ2AE7shB7CAJQhQmLQMLKscOzkXDAqAMwArAAMEaJcAIyyhNGx8YnJOJlZxpFcAEwFRXEJSSoV2SJcKfWwxU1lFQKhANwgBiAQAA4w7NCYyKDU-v4QrAAKCwizKNSkrNSOIyD0-tRgenAwAMq...
prettier/prettier
11,685
prettier__prettier-11685
[ "11684" ]
2e450529f2f0940f18a1bf3ad57c9313bec780c7
diff --git a/src/language-markdown/embed.js b/src/language-markdown/embed.js --- a/src/language-markdown/embed.js +++ b/src/language-markdown/embed.js @@ -21,9 +21,13 @@ function embed(path, print, textToDoc, options) { const style = styleUnit.repeat( Math.max(3, getMaxContinuousCount(node.value, styleU...
diff --git a/tests/format/markdown/code/__snapshots__/jsfmt.spec.js.snap b/tests/format/markdown/code/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/markdown/code/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/markdown/code/__snapshots__/jsfmt.spec.js.snap @@ -290,3 +290,22 @@ hello world =================...
Prettier removes trailing comma of generic arrow function in Markdown tsx codeblock **Prettier 2.4.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEADdACGBnAHgHSkimxizlIwF4MAeAFQBoA+ACgDcBDAGwFc4kGegEpqzDMAC+AbkLpUhEIxAQADjACW0bMlCcATvogB3AAoGEOlD2OcAnjuUAjfZzABrODADKnALZwADIaUHDIAGY82HDOrh5e3qp...
2021-10-16T14:47:57Z
2.5
[]
[ "tests/format/markdown/code/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEADdACGBnAHgHSkimxizlIwF4MAeAFQBoA+ACgDcBDAGwFc4kGegEpqzDMAC+AbkLpUhEIxAQADjACW0bMlCcATvogB3AAoGEOlD2OcAnjuUAjfZzABrODADKnALZwADIaUHDIAGY82HDOrh5e3qpuIQDmyDD6-Mpwfk5wACb5BYGcUCm8nClwAGIQ+n6cMJplyCCcvDAQSiAAFjB+3ADqPRrw2ElgcN6Woxrso3atYNiOICHR+jCmrikNEVExIABWeN6p3HAA...
prettier/prettier
11,717
prettier__prettier-11717
[ "11716" ]
d3163259c7a1c0cfac5c78d6e35e28bf51fbd4ba
diff --git a/src/language-js/needs-parens.js b/src/language-js/needs-parens.js --- a/src/language-js/needs-parens.js +++ b/src/language-js/needs-parens.js @@ -140,6 +140,10 @@ function needsParens(path, options) { break; case "Identifier": return false; + case "Tagg...
diff --git a/tests/format/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap @@ -41,6 +41,16 @@ export...
Typescript Issue: Template string based decorators are wrapped with parentheses I've developed an experimental project called [Dogma](https://www.npmjs.com/package/@dogmajs/core) that implements a template string based decorator to annotate retrievable comments for properties. **Prettier 2.4.1** https://prettier....
2021-10-25T11:35:09Z
2.5
[ "tests/format/misc/typescript-babel-only/jsfmt.spec.js", "tests/format/misc/errors/babel-ts/jsfmt.spec.js" ]
[ "tests/format/misc/typescript-only/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgCpyYw7AA6UOOAAgCIQDmAtugHSSOMLEAGAsgJ452nWN3KV4ADxhIcRAE4BLKPXIBfEABoQEAA4xF0TMlDp58iAHcACmYTGU6VJfT9j2gEbz0YANZwYAGV0TgAZZThkADMnTDhPbz8AwN0fZXpkGHkAV3iQOEYPOAATYpLQ9BVs9Ho4ADEIeWYYAxVkEHRsmAgtEAALGEZUAHU+xXhMVLA4QPtxxQA3cf52sGxe5Tj5GGtvJnRo2LyAK0xJQPTUO...
prettier/prettier
11,800
prettier__prettier-11800
[ "11797" ]
ffbd04ebe286f6cf65bad5b6a0a0ade65af29153
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -75,6 +75,7 @@ const { lastLineHasInlineComment, isAtWordPlaceholderNode, isConfigurationNode, + isParenGroupNode, } = require("./utils...
diff --git a/tests/format/js/multiparser-css/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/multiparser-css/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/multiparser-css/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/multiparser-css/__snapshots__/jsfmt.spec.js.snap @@ -401,6 +401,43 @@ const style3...
Emotion css broken by space added between templated function name and opening parenthesis **Prettier 2.4.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAHAhgJ1wHNDsALTAXkzDTQAMAdKTTAM2hgFo0BLALzhJMARgBM2AB4BuZs1YxCUNB3wBbYQBJgANzj4sAfkwByRbmUAbXPACaJzMLNK01+AA0TAXwAU281Y2vNCYANSYZBYAJpZw...
2021-11-12T07:48:21Z
2.5
[]
[ "tests/format/js/multiparser-css/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAHAhgJ1wHNDsALTAXkzDTQAMAdKTTAM2hgFo0BLALzhJMARgBM2AB4BuZs1YxCUNB3wBbYQBJgANzj4sAfkwByRbmUAbXPACaJzMLNK01+AA0TAXwAU281Y2vNCYANSYZBYAJpZwAPJsbGhwMF5SAJSyUPRZIAA0IBDYMMHKyKAE+BAA7gAKBAhoyCC4ltW4AJ5NBQBGhGAA1ikAyrhqcAAyvFBwyGytyb39QzDDeGDTRMiKAK5wBXBqPXBRUScTFkQ...
prettier/prettier
11,884
prettier__prettier-11884
[ "11878" ]
62ede8b710731228dddc8e900fe99e5d3cc487a8
diff --git a/src/language-js/print/type-annotation.js b/src/language-js/print/type-annotation.js --- a/src/language-js/print/type-annotation.js +++ b/src/language-js/print/type-annotation.js @@ -4,7 +4,7 @@ const { printComments, printDanglingComments, } = require("../../main/comments.js"); -const { getLast } = ...
diff --git a/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap @@ -208,6 +208,71 @@ export interface Sho...
When formatting TypeScript generics, a comma was incorrectly inserted in the empty array. **Prettier 2.5.0** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEMCeAHOACAhrgIwLDABNSAeXAPmwF5sBtAXQB1ZMcBrAKwAsArqQCWAMy64ANgFswUURQgEe2OAA94UUgGdsAJTiQATpW0wjwqAHMANNgFQuUCAHco1O-nKjRVq6o0EHWwzC2sWejxCYjJK...
Minimal reproduce: **Prettier 2.5.0** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEMCeAHOACAYhCbAXmwG0BdAbhABoQIMYBLaAZ2VAEMAnbiAdwAKPBOxScANv05p2dAEbdOYANZwYAZU4BbOABkmUOMgBmk1nAVLV6jRmWGA5shjcArpZBxt8uABM-fz1OKEc3Tkc4fG5tThhmUOQQTjcYCFoQAAsYbQkAdUymeFZ7MDgNUSKmADcitCSwVjkQQwtuGEElR1jTc08AK1...
2021-11-30T12:59:49Z
2.6
[]
[ "tests/format/typescript/tuple/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEMCeAHOACAhrgIwLDABNSAeXAPmwF5sBtAXQB1ZMcBrAKwAsArqQCWAMy64ANgFswUURQgEe2OAA94UUgGdsAJTiQATpW0wjwqAHMANNgFQuUCAHco1O-nKjRVq6o0EHWwzC2sWejxCYjJKJR5qWgYvUh8-AM1glgB+bCg4ADc4IyQ8wuKQGxAIDBhhaG1kUFwjI1cABRaERpQpF1w0RqqCI1wwLjgYAGVcaTgAGUs4ZFEpbThh0fHJqYwxyytkcwENkDhpAjh...
prettier/prettier
11,900
prettier__prettier-11900
[ "11899" ]
d09545952ef6cc37b1f0ad985ef0c1e3887b7e56
diff --git a/src/language-handlebars/utils.js b/src/language-handlebars/utils.js --- a/src/language-handlebars/utils.js +++ b/src/language-handlebars/utils.js @@ -32,6 +32,7 @@ function isGlimmerComponent(node) { return ( isNodeOfSomeType(node, ["ElementNode"]) && typeof node.tag === "string" && + node....
diff --git a/tests/format/handlebars/basics/__snapshots__/jsfmt.spec.js.snap b/tests/format/handlebars/basics/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/handlebars/basics/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/handlebars/basics/__snapshots__/jsfmt.spec.js.snap @@ -93,6 +93,30 @@ printWidth: 80 ==...
Glimmer: Named blocks without content are self-closed on format **Prettier 2.5.0** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAeAwhAtgB2gmAdQEsYALAOQEMs4ATAIQBsIwBrAZwD4AdKAAn6okAM2IAnDjAC0UGvWkAjFuy6oA9KIlTZ8ukpVteAoUg5xIUfXNr7lrI0M3nL1vQYfHBwmwvvtpAHdSMmlILFpYLmBgAEJ+ABEIfigIGH5LADc4cXSYZKoB...
Hi @Windvis, thanks for the detailed report! For reference, even though the RFC allegedly supports self-closing named blocks, it stopped supporting later (https://github.com/glimmerjs/glimmer-vm/commit/7f8b6384d4ff1ff0c14d1c64585fb86be47e2bd4).
2021-12-01T16:01:30Z
2.6
[]
[ "tests/format/handlebars/basics/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAeAwhAtgB2gmAdQEsYALAOQEMs4ATAIQBsIwBrAZwD4AdKAAn6okAM2IAnDjAC0UGvWkAjFuy6oA9KIlTZ8ukpVteAoUg5xIUfXNr7lrI0M3nL1vQYfHBwmwvvtpAHdSMmlILFpYLmBgAEJ+ABEIfigIGH5LADc4cXSYZKoBOFwYAE9+OCZiggBfGo0kXztDIJCw7EiYL1MmjwDg8nbYAi4ACUqWBt7-NlbBy3govg1MXHxYEnJqW2YHbj4+GPjU8SwqJgqqz...
prettier/prettier
11,941
prettier__prettier-11941
[ "11939" ]
db0604eddd203031328b1ff88044dfdd0caf3c60
diff --git a/src/language-js/loc.js b/src/language-js/loc.js --- a/src/language-js/loc.js +++ b/src/language-js/loc.js @@ -32,7 +32,8 @@ function locEnd(node) { * @returns {boolean} */ function hasSameLocStart(nodeA, nodeB) { - return locStart(nodeA) === locStart(nodeB); + const nodeAStart = locStart(nodeA); + ...
diff --git a/tests/integration/__tests__/__snapshots__/format-ast.js.snap b/tests/integration/__tests__/__snapshots__/format-ast.js.snap new file mode 100644 --- /dev/null +++ b/tests/integration/__tests__/__snapshots__/format-ast.js.snap @@ -0,0 +1,21 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`formatAS...
Invalid shorthand for ExportSpecifier Sorry for not following the usual issue formatting but this issue is only available via the API: ```js // Actual: export {specifier1}; // Expected: export {specifier1 as specifier2}; console.log(require("prettier").format(".", { parser: () => ({ type: "Program", ...
Location info is required to use Prettier. But we can check specifier name first
2021-12-09T12:29:50Z
2.6
[]
[ "tests/integration/__tests__/format-ast.js" ]
JavaScript
[]
[]
prettier/prettier
11,992
prettier__prettier-11992
[ "11991" ]
a91465dfdef9e41995317756240c975c8acc8390
diff --git a/src/language-js/utils.js b/src/language-js/utils.js --- a/src/language-js/utils.js +++ b/src/language-js/utils.js @@ -308,7 +308,10 @@ function isTemplateLiteral(node) { } /** - * Note: `inject` is used in AngularJS 1.x, `async` in Angular 2+ + * Note: `inject` is used in AngularJS 1.x, `async` and `fa...
diff --git a/tests/format/js/test-declarations/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/test-declarations/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/test-declarations/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/test-declarations/__snapshots__/jsfmt.spec.js.snap @@ -276,6 +276,133 @@ fun...
Prettier does not recognize test-statement when using "waitForAsync" instead of "async" **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuE8DOMAUByAZhCAAgCMBDAJ2wBpCB3UgSxgDEJyBBNATyjE0wCUhALwA+QsAA6UQoUhQMhfEWGFJIMuXUBuabLgAPAA5wwWZQIB0MCAFEAjgFdSAG0zrN6gdIC+AgdogVCAQRjAM0GjIoBTkEL...
Probably requires a simple addition to the method `isAngularTestWrapper` (in file `/src/language-js/utils.js`): ``` function isAngularTestWrapper(node) { return ( isCallExpression(node) && node.callee.type === "Identifier" && (node.callee.name === "async" || node.callee.name === "inject" || ...
2021-12-20T14:20:35Z
2.6
[]
[ "tests/format/js/test-declarations/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuE8DOMAUByAZhCAAgCMBDAJ2wBpCB3UgSxgDEJyBBNATyjE0wCUhALwA+QsAA6UQoUhQMhfEWGFJIMuXUBuabLgAPAA5wwWZQIB0MCAFEAjgFdSAG0zrN6gdIC+AgdogVCAQRjAM0GjIoBTkELQAChQIUSiu9FxRwcTkpGAA1nAwAMqkALZwADIMUHDIuK5ocNm5BUXFRnk1AObIMOSOzSBwZcRwACbjE5WkUN3O3XCs5GWkMOFzyCCkjjZBIAAWMGUuAOoHTHB...
prettier/prettier
12,017
prettier__prettier-12017
[ "10250" ]
c9c6d3364f8cf5140c3c16b44b92943464be7873
diff --git a/src/language-js/comments.js b/src/language-js/comments.js --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -27,6 +27,7 @@ const { isObjectProperty, getComments, CommentCheckFlags, + markerForIfWithoutBlockAndSameLineComment, } = require("./utils.js"); const { locStart, loc...
diff --git a/tests/format/js/if/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/if/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/if/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/if/__snapshots__/jsfmt.spec.js.snap @@ -87,6 +87,59 @@ function f() { ==================================================...
why the if comment is line breaked? Is there any way to prevent line break? **Prettier 2.2.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEMCGaDWAgpgLyYAUAlKQHybAC+AOlJFBtnvgEKkXUk6jFmw64CAYT5Va9ZlBYB6AFTKWmTMswABAA44ATjgC29AEYQIAGzg4oDTAEs0mALTY4HfUePrNilgAzAFdWGEdoDwxyZ2pgP0dAmLRqcSI...
The intention was to support these often-requested cases: ```js function test(is) { if (is) { taskA() } // case 1 "comment before else" else if (!is) { taskB() } // case 2 "comment after }", for things like "// end if ..." else taskC() } ``` This issue might be an unintended side-effect...
2022-01-01T17:43:01Z
2.6
[]
[ "tests/format/js/if/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEMCGaDWAgpgLyYAUAlKQHybAC+AOlJFBtnvgEKkXUk6jFmw64CAYT5Va9ZlBYB6AFTKWmTMswABAA44ATjgC29AEYQIAGzg4oDTAEs0mALTY4HfUePrNilgAzAFdWGEdoDwxyZ2pgP0dAmLRqcSIZRUUnFxJczAAVA2C4WXyuQj84KzQSxPIAQljOAm4MrOdSPIAxHGqSwQKubkq+5vwJNuzOslCAEzhAxyg4WdKuCRZ5EAAaEAhdcPRkUEMDCAB3AAV...
prettier/prettier
12,075
prettier__prettier-12075
[ "12073" ]
dd3e1a49e04b7fd147dfbccb2489cc5967304491
diff --git a/src/language-js/comments.js b/src/language-js/comments.js --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -68,6 +68,7 @@ function handleOwnLineComment(context) { handleAssignmentPatternComments, handleMethodNameComments, handleLabeledStatementComments, + handleBreak...
diff --git a/tests/config/format-test.js b/tests/config/format-test.js --- a/tests/config/format-test.js +++ b/tests/config/format-test.js @@ -39,6 +39,7 @@ const unstableTests = new Map( ["flow/no-semi/comments.js", (options) => options.semi === false], "typescript/prettier-ignore/mapped-types.ts", "js/...
Prettier [error] -> Comment "' + comment.value.trim() + '" was not printed..." [Playground Link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBuABAWwgEwK4A2cAdHAB4AOEATjAM7F0AWcBBAomXGOgLzoAzPFDAwAltHTNWHLmAAUkTJgCGUHAEoAOlHTpg6AG4rq6AmKhw6fKSzak5iiMrU4ANMDpiisJDGp4cAC+GsQQeDAUEYwU5jDyAPRaOgnauugYBBAA5vIARhAEOE4u6...
Please follow the issue template, i.e. include a reproduction in the Prettier Playground. Here it is: [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBuABAWwgEwK4A2cAdHAB4AOEATjAM7F0AWcBBAomXGOgLzoAzPFDAwAltHTNWHLmAAUkTJgCGUHAEoAOlHTpg6AG4rq6AmKhw6fKSzak5iiMrU4ANMDpiisJDGp4cAC+GsQQeDAUEYwU5jDyAPRaOg...
2022-01-11T18:13:22Z
2.6
[ "tests/format/misc/errors/typescript/jsfmt.spec.js" ]
[ "tests/format/js/for/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBuABAWwgEwK4A2cAdHAB4AOEATjAM7F0AWcBBAomXGOgLzoAzPFDAwAltHTNWHLmAAUkTJgCGUHAEoAOlHTpg6AG4rq6AmKhw6fKSzak5iiMrU4ANMDpiisJDGp4cAC+GsQQeDAUEYwU5jDyAPRaOgnauugYBBAA5vIARhAEOE4u6hppehgCNOjyxqZi6BZmFlYVevotlnQA2mIAusT+Ypg6HRlNArUAhObdff0a6JCwFoHoCQlSANZiFOh5BGrbXVZjHZk58...
prettier/prettier
12,113
prettier__prettier-12113
[ "12114" ]
53da86c34dd1c1e1241e85c57469100f2467fcec
diff --git a/src/language-html/syntax-vue.js b/src/language-html/syntax-vue.js --- a/src/language-html/syntax-vue.js +++ b/src/language-html/syntax-vue.js @@ -40,8 +40,13 @@ function parseVueFor(value) { if (!inMatch) { return; } + const res = {}; res.for = inMatch[3].trim(); + if (!res.for) { + re...
diff --git a/tests/format/vue/invalid/__snapshots__/jsfmt.spec.js.snap b/tests/format/vue/invalid/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/vue/invalid/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,52 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`v-for.vue format ...
[vue] v-for incorrectly removing commas from left hand side **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAeeBbADgGwIbwB8AOlAARmoAmAlgG5l0C0AZhAE4C8xIAFADR5+AIwCUZCCzJgehVAHpadElAWZcBOCpD8QELDBrQAzslB527CAHcAChYSmUeHNbwBPU7uHs8YANZwMADKeBhwADI0UHDILC7GcN6+AUHBWH7RAObIMOwArkkgcB...
2022-01-18T13:11:35Z
2.6
[]
[ "tests/format/vue/invalid/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAeeBbADgGwIbwB8AOlAARmoAmAlgG5l0C0AZhAE4C8xIAFADR5+AIwCUZCCzJgehVAHpadElAWZcBOCpD8QELDBrQAzslB527CAHcAChYSmUeHNbwBPU7uHs8YANZwMADKeBhwADI0UHDILC7GcN6+AUHBWH7RAObIMOwArkkgcBjCcFRU5RF4UFn5eFlwAGIcGASGtcggePkwEDogABYwGDgA6oM08MYZYHDBjlP0U+5dYMZeINGJ7DC2vlltcQlFAFbGAB7...
prettier/prettier
12,177
prettier__prettier-12177
[ "12108" ]
9106e7ea1353a2f7c03026f939d540206620f66f
diff --git a/src/language-js/comments.js b/src/language-js/comments.js --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -24,6 +24,7 @@ const { isCallExpression, isMemberExpression, isObjectProperty, + isLineComment, getComments, CommentCheckFlags, markerForIfWithoutBlockAndSameL...
diff --git a/tests/format/js/switch/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/switch/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/switch/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/switch/__snapshots__/jsfmt.spec.js.snap @@ -30,6 +30,41 @@ switch(x) { } } +switch(x) { + default: // ...
`switch` formatting: `case: // comment` and `default: // comment` have different outcomes **Prettier 2.3.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEATnAIYAmA+gM4wnwC2CMAFAJT7AA6U++VA7jhhgAFvmYAHOHADWFGXACe-CITJt2XHr3xgSVOPgDSSlWoB0OehIA2SfAHoH+K7YA8AFQB8+AOKEIfhscKABzTx9UVXwAdQ...
2022-01-27T20:56:18Z
2.6
[]
[ "tests/format/js/switch/jsfmt.spec.js" ]
JavaScript
[ "https://user-images.githubusercontent.com/30108880/149655786-0ca0c50e-30ac-4811-bbbb-9948f89f6cb3.png" ]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEATnAIYAmA+gM4wnwC2CMAFAJT7AA6U++VA7jhhgAFvmYAHOHADWFGXACe-CITJt2XHr3xgSVOPgDSSlWoB0OehIA2SfAHoH+K7YA8AFQB8+AOKEIfhscKABzTx9UVXwAdQgbVA4AX24dHWIYdEIeAElrGwARODAbEkI6PChzYnI2AG5uVJ0yOFQSdBsYeyd8OAAPCWIqKkqG7TSMrJ4AUQGhkegAZVoGJmrSdVYx3hSoXZAAGhAICVxoKmRQM...
prettier/prettier
12,185
prettier__prettier-12185
[ "11145" ]
e3efd11401e73b824e7da0cd407ada4fa928c0a0
diff --git a/src/language-js/comments.js b/src/language-js/comments.js --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -459,6 +459,7 @@ function handleMethodNameComments({ if ( enclosingNode && precedingNode && + getNextNonSpaceNonCommentCharacter(text, comment, locEnd) === "(" &&...
diff --git a/tests/format/typescript/comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/comments/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/typescript/comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/comments/__snapshots__/jsfmt.spec.js.snap @@ -28,6 +28,40 @@ abstract c...
Misplaced parameter comment in abstract method **Prettier 2.3.0** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBDARgZxgJ1WGAAjABtVNNCAxCCQ4AHSkMI2zwMPVRwAomWLAPQAqEcQgBbSQiJwAHgAcyASyhqA5oQCumODgCSAE0KKeqSYRFCBg3fuMAaWwEomAXxCOQERTBXQmMigPDgQAO4ACjwIQSioJOGoAJ5B3ugcANZwMADKZmCayLjacN5wkuhwRkbVAD...
Also it happens for a method that has no body. **Prettier 2.3.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgGIQQ7AA6UOOARugE4AUZFFA9AFSs6QC2XCMOcAB4AHDAEsoEgOY4Arpjg0AkgBMcw2ui45WzRk3mLVAGn0BKMgF8QxkBGEwx0TMlC0aEAO4AFWghco6Kie6ACeLraUNOhgANZwMADKGmDSyDA0snC2cFyUcCoqBQAy6FBSsuhScA...
2022-01-28T20:59:05Z
2.6
[]
[ "tests/format/typescript/comments/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBDARgZxgJ1WGAAjABtVNNCAxCCQ4AHSkMI2zwMPVRwAomWLAPQAqEcQgBbSQiJwAHgAcyASyhqA5oQCumODgCSAE0KKeqSYRFCBg3fuMAaWwEomAXxCOQERTBXQmMigPDgQAO4ACjwIQSioJOGoAJ5B3ugcANZwMADKZmCayLjacN5wkuhwRkbVADKoUBraqBpwNDiSqDD+Tcho2jAQXiAAFjCSJADqoyrwmAVwubFzKgBuc8n9YBQjano4MJF4Gl3IAGYJet...
prettier/prettier
12,213
prettier__prettier-12213
[ "10291" ]
e22c4911f8bb951932715a7223dc29a81dfdb982
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -493,8 +493,8 @@ function genericPrint(path, options, print) { grandParent.type === "value-func" && grandParent.value === "selec...
diff --git a/tests/format/css/atrule/__snapshots__/jsfmt.spec.js.snap b/tests/format/css/atrule/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/css/atrule/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/css/atrule/__snapshots__/jsfmt.spec.js.snap @@ -3482,6 +3482,8 @@ $background @mixin button-variant($foo: " ...
scss mixin breaks on format if name is "selector" <!-- BEFORE SUBMITTING AN ISSUE: 1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experiencing, ...
Just FYI: There seems to be a workaround: Add a space between closing quote and closing parenthesis. I started analyzing the bug with the following test: ```scss @mixin selector($param: 'value') { } @mixin selector($param: 'value' ) { } @mixin selector($param: "value") { } @mixin selector( $param: "value" ...
2022-02-02T12:30:14Z
2.6
[]
[ "tests/format/css/atrule/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground" ]
prettier/prettier
12,226
prettier__prettier-12226
[ "12220" ]
e73a7bc47ebcfc991104689df097b910ceb251c9
diff --git a/src/language-js/needs-parens.js b/src/language-js/needs-parens.js --- a/src/language-js/needs-parens.js +++ b/src/language-js/needs-parens.js @@ -95,7 +95,6 @@ function needsParens(path, options) { node.type === "LogicalExpression" || node.type === "NewExpression" || node.t...
diff --git a/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.j...
JSDoc super class type override becomes broken **Prettier 2.3.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgCo5wAe8UAJrgPQBU1OAAjAJ4AOcOwAYhBADwBC6AE4A+AL45qlHAApuEAJQcxIADQgILGAEtomZKGFCIAdwAKwhPpTpUJ9E33qARkPRgA1nBgBlFu+0oAHNkGCEAVzh1OABbZzgyMgSAGXRg8PQguG4hGPQYHWDkEHRwmAg1EAALGBj...
@wmertens Yeah, Prettier shouldn't move this comment, it's a bug. But unrelated to the bug, shouldn't the syntax be something like this? ```js /** @extends {Foo<Bar>} */ class T extends Foo {} ``` I wish, it looks like the extends keyword can't use generics. i can't get it to work in any case Is that using ts...
2022-02-05T13:54:12Z
2.6
[]
[ "tests/format/js/comments-closure-typecast/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgCo5wAe8UAJrgPQBU1OAAjAJ4AOcOwAYhBADwBC6AE4A+AL45qlHAApuEAJQcxIADQgILGAEtomZKGFCIAdwAKwhPpTpUJ9E33qARkPRgA1nBgBlFu+0oAHNkGCEAVzh1OABbZzgyMgSAGXRg8PQguG4hGPQYHWDkEHRwmAg1EAALGBjUAHUq7XhMfzA4Hytm7QA3ZqZisGxKwMw4IRgzNyC85AAzWzH1ACtMIn43T28fdBi4ZMC4ecWokFWiH0C...
prettier/prettier
12,260
prettier__prettier-12260
[ "12257" ]
b1645073b897bfc4318186bc42936bf91e86538b
diff --git a/src/language-js/needs-parens.js b/src/language-js/needs-parens.js --- a/src/language-js/needs-parens.js +++ b/src/language-js/needs-parens.js @@ -1,6 +1,7 @@ "use strict"; const getLast = require("../utils/get-last.js"); +const isNonEmptyArray = require("../utils/is-non-empty-array.js"); const { ge...
diff --git a/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/decorators/__snapshots__/jsfmt.spec.js.snap @@ -51,16 +51,20 @@ export class Bar {} export defau...
Missing parens for `ClassExpression` with decorators **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAKAAgM1QSgARgA2AhgM6l7AC+OA3CADQgQAOMAltKcqMQE58IAdwAK-BNxTFCQ4gE9uTAEZ9iYANZwYAZWIBbOABl2UOMkzTScZao1btLNSYDmyGHwCu1kHD1K4ACYBgYbEUM4exM5wAGIQfHrEMBzhyCDEHjAQjCAAFjB6hADquezwpI5g...
2022-02-07T08:38:33Z
2.6
[]
[ "tests/format/js/decorators/class-expression/jsfmt.spec.js", "tests/format/js/decorators/jsfmt.spec.js", "tests/format/typescript/type-arguments-bit-shift-left-like/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAKAAgM1QSgARgA2AhgM6l7AC+OA3CADQgQAOMAltKcqMQE58IAdwAK-BNxTFCQ4gE9uTAEZ9iYANZwYAZWIBbOABl2UOMkzTScZao1btLNSYDmyGHwCu1kHD1K4ACYBgYbEUM4exM5wAGIQfHrEMBzhyCDEHjAQjCAAFjB6hADquezwpI5gcNoSZewAbmVyaWDkOSZWfDAiqs6J5pbeAFakAB7aLoRwAIoeEPADhFZMjnydaUrE-oQ5LHwmMEXsATC5yAAcAA...
prettier/prettier
12,302
prettier__prettier-12302
[ "11401" ]
ceed26dee3392cb83b5b0df750d56393f2c422b4
diff --git a/src/language-handlebars/parser-glimmer.js b/src/language-handlebars/parser-glimmer.js --- a/src/language-handlebars/parser-glimmer.js +++ b/src/language-handlebars/parser-glimmer.js @@ -12,8 +12,21 @@ function addBackslash(/* options*/) { return { name: "addBackslash", visitor: { - TextNo...
diff --git a/tests/format/handlebars/escape/__snapshots__/jsfmt.spec.js.snap b/tests/format/handlebars/escape/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/handlebars/escape/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/handlebars/escape/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,37 @@ // Jest Snapshot v1...
Prettier should not re-escape a backslash in a string literal ## Description Formatting handlebars prettier is escaping a backslash with another backslash. Currently this PR only adds a breaking test. For this example ```hbs <DateFormat @pathFormat="dateFormat:YYYY-MM-DD hh\:mm\:ss" /> ``` Current output...
Can you open an issue instead? Or do you want fix it? I have tried to fix it. But I was in able to fix it. @fisker Is it worth adding a failing test and a issue. Have you try unescape [here](https://github.com/prettier/prettier/blob/2380e113624300bfee65cc9ea1cffae44e8208be/src/language-handlebars/printer-glimmer.js#...
2022-02-13T15:35:42Z
2.6
[]
[ "tests/format/handlebars/escape/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground-redirect" ]
prettier/prettier
12,349
prettier__prettier-12349
[ "12270" ]
2cde2dbf9d280260f8c499039d89419b21fa4dc0
diff --git a/src/language-js/print/assignment.js b/src/language-js/print/assignment.js --- a/src/language-js/print/assignment.js +++ b/src/language-js/print/assignment.js @@ -2,7 +2,7 @@ const { isNonEmptyArray, getStringWidth } = require("../../common/util.js"); const { - builders: { line, group, indent, indentIf...
diff --git a/tests/format/js/assignment-comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/assignment-comments/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/assignment-comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/assignment-comments/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,47 @@ ...
Unstable formatting: variable assignment, expression in parentheses, method call **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLAZgAgBQwE4CucAlADpSaYY75FkWVVa6EnmOPUt3sefO02DPowA20AOYA1AIZ5UMgEai4AORkBbOAEZMAXkwB6Q5gACMAM4BaVBKgQ8cXiMrYAbnIXK4ABl0BqTDc4PABPABlJWXklFXUtVQINRRCA...
Another manifestation: **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEBrCYAWAhgEYDCEEAlnAOKEC2cA8lE8RADZwCqUA7nEIA3OJgC8mAPSTMAfnkAdKJhWqATvgCuxQmuIAlLTr0AKQlCiaOu8hDhwAJgGUADh0pg4aAOqEO2H0IAT18ggEoAbiUlEAAaEAgXGEp0ZFBdNQg+AAVdBDRkED8+YIL44jVCMGw4GCcGOAAZSig4ZAAzPzQ4csr...
2022-02-22T15:45:45Z
2.6
[]
[ "tests/format/js/assignment-comments/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLAZgAgBQwE4CucAlADpSaYY75FkWVVa6EnmOPUt3sefO02DPowA20AOYA1AIZ5UMgEai4AORkBbOAEZMAXkwB6Q5gACMAM4BaVBKgQ8cXiMrYAbnIXK4ABl0BqTDc4PABPABlJWXklFXUtVQINRRCAJmIAOi0YAAsIABNsYgBuchAAGhAIAAcYVGgLZFA5PAgAdwAFOQRGlBlRNplQxsrFPBkwAGs4GABlTThw1Cg4ZHR+izhR8amZ2eqJ5YlkQUq4ZLh8-M...
prettier/prettier
12,362
prettier__prettier-12362
[ "12352" ]
896970a18518bc31f1f15233b5ec612394453624
diff --git a/src/document/doc-printer.js b/src/document/doc-printer.js --- a/src/document/doc-printer.js +++ b/src/document/doc-printer.js @@ -202,10 +202,6 @@ function fits(next, restCommands, width, options, hasLineSuffix, mustBeFlat) { ? getLast(doc.expandedStates) : doc.contents, ...
diff --git a/tests/format/js/arrays/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/arrays/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/arrays/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/arrays/__snapshots__/jsfmt.spec.js.snap @@ -56,9 +56,7 @@ printWidth: 80 } } { - for (const srcPath of ...
Unnecessary line breaks caused by `ifBreak` with group id nested in `group` with the same id **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEwA6UAEmBmEBOmAFJFAM4yZn5gAKAhjABaYQ6YDaAjAEwDMAGky8+AfRHj+QiTP7jpYiXyVdRAFj48AugEpM6LJgC+GIyAEgIABxgBLaGWSh6+fBADuDfAkcp6AG3d6AE9HCwAjfHowA...
It's known: #10159 I'll close that issue in favor of this one because you have a better description here. The root cause is described here: https://github.com/prettier/prettier/pull/10160#issuecomment-768668404 Sorry, totally forgot about that. After debugging with your doc [here](https://github.com/prettier/prettier...
2022-02-24T10:35:18Z
2.6
[]
[ "tests/format/typescript/interface/long-type-parameters/jsfmt.spec.js", "tests/format/js/arrays/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEwA6UAEmBmEBOmAFJFAM4yZn5gAKAhjABaYQ6YDaAjAEwDMAGky8+AfRHj+QiTP7jpYiXyVdRAFj48AugEpM6LJgC+GIyAEgIABxgBLaGWSh6+fBADuDfAkcp6AG3d6AE9HCwAjfHowAGs4GABlegBbOAAZWyg4ZBwAsjgIqNj4hKtozIBzZBh8AFcCkDhk8LgAE1a2tPooCtr6CrgAMQJkxjse5BB6WpgIcxAmGGT-AHUmW3gyMrA4BJ8N2wA3DeDJsDIwkEz...
prettier/prettier
12,390
prettier__prettier-12390
[ "12389" ]
542549c37216e9a32d555276089ee889c15c9fca
diff --git a/src/language-js/print/type-annotation.js b/src/language-js/print/type-annotation.js --- a/src/language-js/print/type-annotation.js +++ b/src/language-js/print/type-annotation.js @@ -4,7 +4,7 @@ const { printComments, printDanglingComments, } = require("../../main/comments.js"); -const { getLast, isN...
diff --git a/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap @@ -1,91 +1,5 @@ // Jest Snapshot v1, ht...
Prettier removes trailing comma from multiline type with `trailingComma: all` **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEMCeAHOACAYgSwCcBnGAFUzgHV8YALANTkLQBloBzAOQEMBbHAF5swADpRs2HkmxQArnwBGzANziAvuPHos2AMpxIUACYUsNekxbso3fkJHjJimfKWqNW2JTz4oPABszalpGZjZOXgFsYQBtJ18SckoLMOt...
https://github.com/prettier/prettier/issues/11684 It's also reproduced This is a remnant of the old TS spec of placing rest elements only at the end of a tuple. I think we can fix this. We can put leading/middle rest type in tuples types since TypeScript 4.2 https://www.typescriptlang.org/docs/handbook/release-notes/t...
2022-03-04T00:52:40Z
2.6
[]
[ "tests/format/typescript/tuple/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEMCeAHOACAYgSwCcBnGAFUzgHV8YALANTkLQBloBzAOQEMBbHAF5swADpRs2HkmxQArnwBGzANziAvuPHos2AMpxIUACYUsNekxbso3fkJHjJimfKWqNW2JTz4oPABszalpGZjZOXgFsYQBtJ18SckoLMOtI+wAaBIA6PIMjUxTQqwjbKLhYgF1sqCqVEEyQCAwYfGhiZFAeQkIIAHcABR6ETpRA-p40TqbFQh4wAGs4GD17Vj84ZAAzQOI4Wfmllb0MBb8OZB...
prettier/prettier
12,508
prettier__prettier-12508
[ "12413" ]
5ef82125a9c2ba0d6d7d5f9711075a2527ab47ee
diff --git a/src/language-js/print/assignment.js b/src/language-js/print/assignment.js --- a/src/language-js/print/assignment.js +++ b/src/language-js/print/assignment.js @@ -441,7 +441,9 @@ function isCallExpressionWithComplexTypeArguments(node, print) { firstArg.type === "TSUnionType" || firstArg.ty...
diff --git a/tests/format/flow/assignments/__snapshots__/jsfmt.spec.js.snap b/tests/format/flow/assignments/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/flow/assignments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/flow/assignments/__snapshots__/jsfmt.spec.js.snap @@ -110,3 +110,52 @@ const map: Map<Funct...
Long lines of code need to be formatted twice **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAbOMAEcC2BLLAXgB0pNzMATOAMzyjgFF8YBnAHmEwAo4A3BDCSZiIAE5wAhpQCeogDSYwkqH0mthACQAqAWQAyAYRVrWjdDkEBKYXwh5KAbh79BSURNZ4AXnAXLVdSQdA2NAswtrJDsHZwBfAD5uK0cQeRAIAAcYPGhWZFBJMTEIAHcABSKEfJRJVF...
I've noticed this is often an issue when combining TypeScript generics with object literals. Here's a second example for reference: **Prettier 2.5.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEGWAPACoB8AFAJT7AC+AOlMwDZwz4CGARmALzN8w4UTDFgXJACYANDyQBmWQBMkAdgAcsuEgCcs1Em0BzDbIAW...
2022-03-22T16:59:30Z
2.7
[]
[ "tests/format/flow/assignments/jsfmt.spec.js", "tests/format/typescript/assignment/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAbOMAEcC2BLLAXgB0pNMATOAMzyjgFF8YBnAHmFPPIAo4A3BDCSZiIAE5wAhhQCeYgDSYwUqPyksRACQAqAWQAyAYVXqWDdDiEBKEfwh4KAbi7c+g2CLGSWeAF5wisqmGtr6xiHmljZ2Ds6uAL4AfDzWTiAKIBAADjB40CzIoFLi4hAA7gAKJQiFKFKo5VKyhZkARuJSYADWGADKUlYGdHDI1A0scO2dPf3ZXXQA5sgw4gCuUyC4bXAUVBQGqotrUotwAGIQ4...
prettier/prettier
12,584
prettier__prettier-12584
[ "12414" ]
c50f2bbe3075757840bbd7ed941647a9bde84266
diff --git a/src/language-html/embed.js b/src/language-html/embed.js --- a/src/language-html/embed.js +++ b/src/language-html/embed.js @@ -127,11 +127,14 @@ function printEmbeddedAttributeValue(node, htmlTextToDoc, options) { if (isKeyMatched(vueEventBindingPatterns)) { const value = getValue(); + co...
diff --git a/tests/format/vue/ts-event-binding/__snapshots__/jsfmt.spec.js.snap b/tests/format/vue/ts-event-binding/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/vue/ts-event-binding/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + ...
"as" TypeScript keyword yields error within Vue template <!-- BEFORE SUBMITTING AN ISSUE: 1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experienci...
Any reference that this is allowed in Vue SFC? @fisker I don't know about any Vue doc covering this specific use case, so official support on this is unknown to me. However, AFAIK Vue 3 fully supports TypeScript and the `as` keyword is part of the language. Furthermore, my app runs just fine with a bunch of `as` keywor...
2022-04-02T18:06:41Z
2.7
[]
[ "tests/format/vue/ts-event-binding/jsfmt.spec.js", "tests/format/vue/ts-expression/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAeeBbADgGwIbwB8AOlKlgAQBuAtAJYBmAvMSHQM4BiEOAJnACcAFAzo44ASlaFgwCiLFwKedhQwBPDBF4BXcQDpufQRP388vHHShKAvrdQB6LIQpv3pJ5lwE4JKJ7sYAJ0WDAU+FAA5iwgMOzSno5BIWH+gcGh4exwMDqUkTGs8YlkyZlppIEw6uIUQRBYcLwReNGxQewJIP5O7DXihCAANCCNMHTQ7MigeAICEADuAApzCNMoeDiLeOrTowBGAnhgANa5AMp...
prettier/prettier
12,608
prettier__prettier-12608
[ "12607" ]
f98c197b66db7491021f5d1cb65d137aa5d7ac68
diff --git a/src/language-graphql/printer-graphql.js b/src/language-graphql/printer-graphql.js --- a/src/language-graphql/printer-graphql.js +++ b/src/language-graphql/printer-graphql.js @@ -125,13 +125,15 @@ function genericPrint(path, options, print) { } case "StringValue": { if (node.block) { - ...
diff --git a/tests/format/graphql/string/__snapshots__/jsfmt.spec.js.snap b/tests/format/graphql/string/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/graphql/string/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/graphql/string/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,82 @@ // Jest Snapshot v1, https://go...
Prettier GraphQL `description` leading space bug **Prettier 2.6.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAdNGAEApCALKTAEQjk3QrVgE8AHMgBTgCcBnaTYVQzKAQwC2cJJgDKMZgEsoAc24BfEABoQEWjEnRWyUH2bMIAdwZ6E2lHwA2hvtW0qARsz5gA1nBijBcADLS4yABmVqxwjs5uHqK0LtIyyBIArmEgcAIOcAAmmVk+fLKJfDJwAGIQzAJ8MBqyy...
2022-04-06T19:35:54Z
2.7
[]
[ "tests/format/graphql/string/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAdNGAEApCALKTAEQjk3QrVgE8AHMgBTgCcBnaTYVQzKAQwC2cJJgDKMZgEsoAc24BfEABoQEWjEnRWyUH2bMIAdwZ6E2lHwA2hvtW0qARsz5gA1nBijBcADLS4yABmVqxwjs5uHqK0LtIyyBIArmEgcAIOcAAmmVk+fLKJfDJwAGIQzAJ8MBqyyCB8iTAQyiB4MAKWAOp4kvCsMWBwoma9kgBuvdR1YKz2INKhzDAMzjKVQSEpAFasAB6icZZwAIqJEPAblqE...
prettier/prettier
12,746
prettier__prettier-12746
[ "12738" ]
e23b89b8c70da643eed9adcfc6b815c7f4432dc2
diff --git a/src/language-js/comments.js b/src/language-js/comments.js --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -65,7 +65,7 @@ function handleOwnLineComment(context) { handleForComments, handleUnionTypeComments, handleOnlyComments, - handleImportDeclarationComments, + ...
diff --git a/tests/format/js/export/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/export/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/export/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/export/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,114 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +expo...
Blank line between export specifiers not preserved **Prettier 2.6.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEcAeAHCAnGACYAHSjzwHoy8BDY0gMwggBpa9WK8AjVzq7FklyoAvAQF8A3CCYgIGGAEtoAZ2Sg+2CAHcACnwSqUVADZaqAT1UzO2KmADWcGAGUqAWzgAZBVDjI6Jspw1rYOTs4Ydj4A5sgw2ACuwahunHAAJukZnlRQ0QlU0XAAYjhuVDCKecg...
2022-04-29T06:46:56Z
2.7
[]
[ "tests/format/js/export/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEcAeAHCAnGACYAHSjzwHoy8BDY0gMwggBpa9WK8AjVzq7FklyoAvAQF88dbBAC2eAOQMI84sXRZcBdpRqClA0tq48+BoaOISpshUpVRiASxkb8RQR131GZo90G8-CYWUFbScoqM9sSQUADObkZekj6sfiZBASLieAC8KRAgTCAQGDCO0HHIoHzSAO4ACnwIVShUADZ1VACeVcWc2FRgANZwMADKVDJwADKOUHDIdB1xcP2DI2PjGEPzAObIMNgArmuoMpxwACZ...
prettier/prettier
12,860
prettier__prettier-12860
[ "12750" ]
77e5589591d0d558ad3c75d10a8bdd554af3c550
diff --git a/src/language-js/comments.js b/src/language-js/comments.js --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -61,7 +61,6 @@ function handleOwnLineComment(context) { handleWhileComments, handleTryStatementComments, handleClassComments, - handleImportSpecifierComments, ...
diff --git a/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap @@ -1474,6 +1474,24 @@ export { barr, // comment } +con...
Inconsistent between comments inside export and import specifiers **Prettier 2.6.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEcAeAHCAnGACYAHSjzwDMIIAaY02vAIwENs8mBnUgei70gFt+CGMUIj8zAF40oAX3LYI-PAHIKEFaKjosuAvXUy6JRizac8PPkqGxR409OKytAS3678RE4fr1mrBzcvAK2IlBiYo4y8mSKymqUKiBUIBAYMK7Q7MigLIoA...
2022-05-11T05:07:44Z
2.7
[]
[ "tests/format/js/comments/jsfmt.spec.js" ]
JavaScript
[]
[ "https://deploy-preview-12746--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEcAeAHCAnGACYAHSjzwDMIIAaY02vAIwENs8mBnUgei70gFt+CGMUIj8zAF40oAX3LYI-PAHIKEFaKjosuAvXUy6JRizac8PPkqGxR409OKytAS3678RE4fr1mrBzcvAK2IlBiYo4y8mSKymqUKiBUIBAYMK7Q7MigLIoA7gAKLAg5KEwANgVMAJ45qQzYTGAA1nAwAMpMQgAyrtrIZFXscI3NbR2dGC0DAObIMNgAr...
prettier/prettier
12,895
prettier__prettier-12895
[ "12787" ]
83ec3c36e34864470a6cb88889d837c46777ab7d
diff --git a/src/language-html/print/tag.js b/src/language-html/print/tag.js --- a/src/language-html/print/tag.js +++ b/src/language-html/print/tag.js @@ -17,6 +17,7 @@ const { isPreLikeNode, hasPrettierIgnore, shouldPreserveContent, + isVueSfcBlock, } = require("../utils/index.js"); function printClosing...
diff --git a/tests/format/vue/single-attribute-per-line/__snapshots__/jsfmt.spec.js.snap b/tests/format/vue/single-attribute-per-line/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/vue/single-attribute-per-line/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/vue/single-attribute-per-line/__snapshots__/jsfmt.sp...
Avoid tags for the singleAttributePerLine rule Is it possible to specify a list of tags to avoid for this rule? I'm working with Vue 3 and I would LOVE to keep both of this tags in one line: ``` <script setup lang="ts" > ... </script> ``` ``` <style scoped lang="scss" > ... </style> ``` ...
Can we disable it for `script` and `style`? me too,how resolve it > We can disable this just like we did with indentation (`vueIndentScriptAndStyle`). answer error me too,how resolve it > me too,how resolve it i dont know. I've given up using prettier
2022-05-20T03:26:24Z
2.7
[]
[ "tests/format/vue/single-attribute-per-line/jsfmt.spec.js" ]
JavaScript
[]
[]
prettier/prettier
12,930
prettier__prettier-12930
[ "12926" ]
3147244f55e6e0aafd2cc6fa5875f7c8cfa8e4e3
diff --git a/src/language-js/print/typescript.js b/src/language-js/print/typescript.js --- a/src/language-js/print/typescript.js +++ b/src/language-js/print/typescript.js @@ -413,7 +413,12 @@ function printTypescript(path, options, print) { return parts; case "TSEnumMember": - parts.push(print("id"))...
diff --git a/tests/format/typescript/enum/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/enum/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/typescript/enum/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/enum/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,53 @@ // Jest Snapshot v1, https:...
Syntax error after formatting when using computed key in TypeScript enum **Prettier 2.6.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuECCuBbABAQS8AHSiywG0BLAakoF0iBfEAGhAgAcZzoBnZUAQwBOgiAHcACkIS8U-ADaj+AT14sARoP5gA1nBgBlfhjgAZclDjIAZvO5x1mnXv1st5gObIYgtPdQY1OAATIOCTfih3NH53OAAxCEEMfhhOSOQQfjQ...
2022-05-27T08:36:59Z
2.7
[]
[ "tests/format/typescript/enum/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuECCuBbABAQS8AHSiywG0BLAakoF0iBfEAGhAgAcZzoBnZUAQwBOgiAHcACkIS8U-ADaj+AT14sARoP5gA1nBgBlfhjgAZclDjIAZvO5x1mnXv1st5gObIYgtPdQY1OAATIOCTfih3NH53OAAxCEEMfhhOSOQQfjQYCGYQAAsYDDkAdXzyeG5XMDh9aQryADcKpQywblUQcztBGHFNd2TrWz8AK24AD30POTgARTQIeGG5OxZXQR6MmCU2OG4wQXIOPLYj2BLyI...
prettier/prettier
12,982
prettier__prettier-12982
[ "12963" ]
be9d63e543b6ac28aa6eee7ab8dc45849cd8f0b3
diff --git a/src/language-js/parse/postprocess/index.js b/src/language-js/parse/postprocess/index.js --- a/src/language-js/parse/postprocess/index.js +++ b/src/language-js/parse/postprocess/index.js @@ -6,6 +6,7 @@ const isTypeCastComment = require("../../utils/is-type-cast-comment.js"); const getLast = require("../.....
diff --git a/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/invalid/__snapshots__/jsfmt.spec.js.snap @@ -156,92 +156,236 @@ export...
Prettier parses `({ methodName() })` incorrectly **Prettier 2.6.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAKYACAtnGALCAEwDkBDHVASgwF9KQAaECABxgEtoBnZUUgJ34QA7gAUBCHilIAbYaQCePJgCN+pMAGtcAZXJwAMuyhxkAM1lc4q9Vt0sNxgObIY-AK7WQcLCriFCfwNSKCd3Uic4ADEIfixSGA5Q5BBSdxgIRhA8GCwZAHU8dnguBzA4HUli9gA...
By the way, testing shows that this doesn't happen with the `babel`, `babel-ts`, `babel-flow`, `acorn`, `espree`, or `meriyah` parsers, so it could be an upstream bug with TypeScript's parser. This might be because of TypeScript's function overloading not working properly in object literals, but I'm not sure. I think t...
2022-06-06T15:27:56Z
2.7
[]
[ "tests/format/misc/errors/invalid/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAKYACAtnGALCAEwDkBDHVASgwF9KQAaECABxgEtoBnZUUgJ34QA7gAUBCHilIAbYaQCePJgCN+pMAGtcAZXJwAMuyhxkAM1lc4q9Vt0sNxgObIY-AK7WQcLCriFCfwNSKCd3Uic4ADEIfixSGA5Q5BBSdxgIRhA8GCwZAHU8dnguBzA4HUli9gA3YoUUsC5lEGMrfhhRdSd480svACsuAA8dZxk4AEV3CHg+mSsmB352lJgFFjguMH52NiyWXdh89kJ8ZAAOA...
prettier/prettier
13,115
prettier__prettier-13115
[ "13018" ]
2c77149e6a3f6d5a74745a23c38e13f2ffebe28d
diff --git a/src/language-js/utils/index.js b/src/language-js/utils/index.js --- a/src/language-js/utils/index.js +++ b/src/language-js/utils/index.js @@ -883,9 +883,26 @@ function isSimpleCallArgument(node, depth) { ); } + const targetUnaryExpressionOperators = { + "!": true, + "-": true, + "+": tr...
diff --git a/tests/format/js/method-chain/13018.js b/tests/format/js/method-chain/13018.js new file mode 100644 --- /dev/null +++ b/tests/format/js/method-chain/13018.js @@ -0,0 +1,8 @@ +foo(_a).bar().leet(); +foo(-a).bar().leet(); +foo(+a).bar().leet(); +foo(~a).bar().leet(); +foo(++a).bar().leet(); +foo(--a).bar().le...
Unary `+` parameter triggers overeager breaking of method chain **Prettier 2.7.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzCEAUB9AhgSgDoAjXAJ0yIBs44ZKBuAHSnSwFoCTzLCa7GLNpgDUXUhWq16+BiAA0ICAAcYAS2gBnZKHJkIAdwAK5BNpS4qB3AE9ti4mVxgA1nQDKuALZwAMmqg4ZFRLTTgHJ1cPZWcAgHNkGDIAV3CQOC9iOAATbJzfXCg...
I have looked into this issue. It seems that the Doc created by prettier is different for `+` parameter and other cases. This Doc is created at the end of `printMemberChain` function in `src/language-js/print/member-chain.js` https://github.com/prettier/prettier/blob/a043ac0d733c4d53f980aa73807a63fc914f23bd/src/la...
2022-07-16T01:21:53Z
2.8
[]
[ "tests/format/js/method-chain/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzCEAUB9AhgSgDoAjXAJ0yIBs44ZKBuAHSnSwFoCTzLCa7GLNpgDUXUhWq16+BiAA0ICAAcYAS2gBnZKHJkIAdwAK5BNpS4qB3AE9ti4mVxgA1nQDKuALZwAMmqg4ZFRLTTgHJ1cPZWcAgHNkGDIAV3CQOC9iOAATbJzfXCg45Nw4uAAxCDIvXBh1IuQQXGSYCAUQAAsYLyoAdQ61eE0YsDh3M0G1ADdBm0awTXsQALCyGCMnOJrg0LSAK00AD3d4mgBFZIh4...
prettier/prettier
13,173
prettier__prettier-13173
[ "12964" ]
b65cb6c1f67d95be8e8f7719f2a4174eaa5fe66c
diff --git a/src/main/range-util.js b/src/main/range-util.js --- a/src/main/range-util.js +++ b/src/main/range-util.js @@ -64,6 +64,9 @@ function findSiblingAncestors( } else { break; } + if (resultStartNode === resultEndNode) { + break; + } } return {
diff --git a/tests/format/js/range/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/range/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/range/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/range/__snapshots__/jsfmt.spec.js.snap @@ -182,6 +182,27 @@ rangeStart: 0 =====================================...
Code-breaking semicolon added when formatting range in arrow function with comment **Prettier 2.6.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAbOMAEAzKmC8mAFEQJQEB8mwAOnpgE4YCuDUA3JgPRd0C+pdiAA0ICAAcYAS2gBnZKACGDBhADuABWUJ5KRajWKAnvNEAjBorABrDAGVFAWzgAZKVDjJs+2XHOWbe3ErdwBzZBgGZj8QOEczOAATR...
I wonder if this is related to #12963, because a semicolon was added improperly in that issue as well. > I wonder if this is related to #12963, because a semicolon was added improperly in that issue as well. I don't think so. This happens with the Babel parser and the parse tree looks correct to me, unlike with #129...
2022-07-24T19:18:04Z
2.8
[]
[ "tests/format/js/range/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAbOMAEAzKmC8mAFEQJQEB8mwAOnpgE4YCuDUA3JgPRd0C+pdiAA0ICAAcYAS2gBnZKACGDBhADuABWUJ5KRajWKAnvNEAjBorABrDAGVFAWzgAZKVDjJs+2XHOWbe3ErdwBzZBgGZj8QOEczOAATRKSXRShQ5kVQuAAxCAZHRRhpDOQQRWYYCBEQAAsYR1QAdTqpeFlgsDg7HXapADd2o3KwWVMQd18GGA1LUKKvHxiAK1kADzsw9ABFZgh4JdRfUWCGafKzR...
prettier/prettier
13,315
prettier__prettier-13315
[ "16493" ]
fa94c3099c4199208abac8a2af0c5716f4cfbb61
diff --git a/src/document/printer.js b/src/document/printer.js --- a/src/document/printer.js +++ b/src/document/printer.js @@ -1,6 +1,6 @@ import { convertEndOfLineToChars } from "../common/end-of-line.js"; import getStringWidth from "../utils/get-string-width.js"; -import { fill, hardlineWithoutBreakParent, indent }...
diff --git a/tests/format/js/template-literals/__snapshots__/format.test.js.snap b/tests/format/js/template-literals/__snapshots__/format.test.js.snap --- a/tests/format/js/template-literals/__snapshots__/format.test.js.snap +++ b/tests/format/js/template-literals/__snapshots__/format.test.js.snap @@ -164,6 +164,8 @@ d...
Modification of nested arrays inside format string <!-- BEFORE SUBMITTING AN ISSUE: 1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experiencing, ...
2022-08-19T08:46:18Z
3.4
[]
[ "tests/format/js/template-literals/format.test.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBDATugBAXiwbXwEYAaLAJgF0z8BmMgFksoB0oAPXLAAwBJgM6AL7cQJEBAAOMAJbQAzslCCIAdwAKGBIpSoANqtQBPReIBG6VGADWcGAGVUAWzgAZGVDjIAZvvlxzSxs7e0krDwBzZBh0AFcAkH8nGWi4hLh2STh0GRdYfQAVbKgMGTgdXz1-cXlIvTgARViIeB8-BIAreXZ7Osbm1qRK6pAARwG4dXQpHTR5AFpPOAATFbEQGNQZPUiAYQgnJ1RkND09ddqo...
prettier/prettier
13,391
prettier__prettier-13391
[ "12597" ]
b7cfea5d5f85bf701560bdce070c6b66c0ac4edc
diff --git a/src/language-js/print/function.js b/src/language-js/print/function.js --- a/src/language-js/print/function.js +++ b/src/language-js/print/function.js @@ -12,6 +12,7 @@ import { softline, group, indent, + dedent, ifBreak, hardline, join, @@ -254,6 +255,10 @@ function printArrowChain( ...
diff --git a/tests/format/js/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/arrows/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/arrows/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/arrows/__snapshots__/jsfmt.spec.js.snap @@ -2062,6 +2062,240 @@ foo( =======================================...
Misaligned indent in curried arrow function **Prettier 2.6.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEwA6UAEn1ezjffSKAZxkwA9MBeTAQQDoAjACkKP3b0+NszQgAhszAATOADMA5gAsAlgCsA1gBsAtlAgAHAI4AncgFcAbgHdKATwBeI8VLlK1mnQePmrt0RMmCANBy82GL8gnY+jioaWnqGMKYWNuEOClEuse6JXva+IIGcAJS0AHz5RKxwRTTFmAAMZZg...
2022-08-28T15:28:50Z
3.0
[]
[ "tests/format/js/arrows/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEwA6UAEn1ezjffSKAZxkwA9MBeTAQQDoAjACkKP3b0+NszQgAhszAATOADMA5gAsAlgCsA1gBsAtlAgAHAI4AncgFcAbgHdKATwBeI8VLlK1mnQePmrt0RMmCANBy82GL8gnY+jioaWnqGMKYWNuEOClEuse6JXva+IIGcAJS0AHz5RKxwRTTFmAAMZZgFANz5AL4c7VCdIH4gOjDy0KTIoEL6+hBmAApjCMMoQqpmQpbDvcz6QmDKcDAAykLqcAAy8lBwyJKL...
prettier/prettier
13,396
prettier__prettier-13396
[ "13395" ]
c8ff3870c321b2d6a99387801437273fc8ea40cf
diff --git a/src/language-js/print/function-parameters.js b/src/language-js/print/function-parameters.js --- a/src/language-js/print/function-parameters.js +++ b/src/language-js/print/function-parameters.js @@ -62,7 +62,7 @@ function printFunctionParameters( const parent = path.getParentNode(); const isParamete...
diff --git a/tests/format/flow/function-single-destructuring/__snapshots__/jsfmt.spec.js.snap b/tests/format/flow/function-single-destructuring/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/flow/function-single-destructuring/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/flow/function-single-destructuring/__...
`declare function` formatted differently for Flow and TypeScript **Prettier 2.7.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEATOYA2BDATnAAgDMBXKMGAS2gICMcCAKAB1wmYGckDgDtvaECJjjYoAGjrcOMXJSgBzSWG5QSAW1pxcBAL4BKJAB0oBAgAU26yhzgAeAIK5c2AJ52iQgHxeQ4kOxU0BzIoHhsAO7meAghKNiYEW4h-rQuYADWcDAAytjqcA...
2022-08-28T23:29:36Z
3.0
[ "tests/format/typescript/declare/jsfmt.spec.js" ]
[ "tests/format/flow/function-single-destructuring/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEATOYA2BDATnAAgDMBXKMGAS2gICMcCAKAB1wmYGckDgDtvaECJjjYoAGjrcOMXJSgBzSWG5QSAW1pxcBAL4BKJAB0oBAgAU26yhzgAeAIK5c2AJ52iQgHxeQ4kOxU0BzIoHhsAO7meAghKNiYEW4h-rQuYADWcDAAytjqcAAy8nDIRAm2qelZuczYYPIKyLIkcP5wmnCo6KiFYgok2ApwAGIQuOrYMFSKyCDYJDAQfiAAFjDqmADqq5TwHHVgcDmxe5QAbnuu...
prettier/prettier
13,402
prettier__prettier-13402
[ "13202" ]
26ea4c42fd3718f4dc9ff600171f4a64ffd54802
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -72,6 +72,7 @@ import { isAtWordPlaceholderNode, isConfigurationNode, isParenGroupNode, + isVarFunctionNode, } from "./utils/index.js";...
diff --git a/tests/format/css/trailing-comma/__snapshots__/jsfmt.spec.js.snap b/tests/format/css/trailing-comma/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/css/trailing-comma/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +expor...
[CSS] Prettier removes trailing comma inside `var` function **Prettier 2.7.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEA6AZhCACYAdKbbAWmICMBDAJyWwDdqAKUygLwBoBKAbgIF8Q7EBAAOMAJbQAzslDUqEAO4AFaghkoKAG0UUAnjKFkqFMAGs4MAMoUAtnAAy4qHGTptUuEZPnLVkabOAObIMFQArl4gcLZkcAAm8QkOFFBB4RRBcABiEFS2FDASa...
2022-08-30T14:33:51Z
3.0
[]
[ "tests/format/css/trailing-comma/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEA6AZhCACYAdKbbAWmICMBDAJyWwDdqAKUygLwBoBKAbgIF8Q7EBAAOMAJbQAzslDUqEAO4AFaghkoKAG0UUAnjKFkqFMAGs4MAMoUAtnAAy4qHGTptUuEZPnLVkabOAObIMFQArl4gcLZkcAAm8QkOFFBB4RRBcABiEFS2FDASacggFOEwEIIgABYwtloA6jXi8FIBYHBW6q3idK16pWBShiDOnlQwyiZBBW4eUQBWUgAeVsFacACK4RDw81qeQgFUE0Mj1SJ...
prettier/prettier
13,410
prettier__prettier-13410
[ "11794" ]
40ffe244a35274419aa9aa15458490c24293f426
diff --git a/src/language-js/print/function.js b/src/language-js/print/function.js --- a/src/language-js/print/function.js +++ b/src/language-js/print/function.js @@ -57,7 +57,13 @@ function printFunction(path, print, options, args) { args?.expandLastArg ) { const parent = path.getParentNode(); - if (is...
diff --git a/tests/format/typescript/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/typescript/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/last-argument-expansion/__...
Improve React forwardRef with named function expression **Prettier 2.4.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLAtgBwgJxgAmHwDNcB3AQxwBMAlOY-AXxJwnXwB0Qc4KwY3ANycoGbHnwwAnpjiF8AGVRQA1gAU2mAM74KugCoALOOjgBVAJLK1miDuat2XEDBNmAtAFdUw0eNwCIhtVPUN3C2sVUJZiNg5uN1M4b18QEShROAAPCQIZOSVouwcAXnw...
2022-09-03T08:16:02Z
3.0
[]
[ "tests/format/typescript/last-argument-expansion/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLAtgBwgJxgAmHwDNcB3AQxwBMAlOY-AXxJwnXwB0Qc4KwY3ANycoGbHnwwAnpjiF8AGVRQA1gAU2mAM74KugCoALOOjgBVAJLK1miDuat2XEDBNmAtAFdUw0eNwCIhtVPUN3C2sVUJZiNg5uN1M4b18QEShROAAPCQIZOSVouwcAXnwAeXRUGAAeY2SrEJLtABoXfW58AB8XI15ibgA+DKzcwPxIKG0CEPxy0hxKGnpiWoAJAwBZRQBBKDAjXABRABtk2Hbm...
prettier/prettier
13,438
prettier__prettier-13438
[ "9959" ]
5766433a62767bf3c9bc5b96aca4fd2495579c34
diff --git a/src/language-js/print/comment.js b/src/language-js/print/comment.js --- a/src/language-js/print/comment.js +++ b/src/language-js/print/comment.js @@ -1,4 +1,3 @@ -import { hasNewline } from "../../common/util.js"; import { join, hardline } from "../../document/builders.js"; import { replaceEndOfLine } fr...
diff --git a/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap @@ -1444,6 +1444,101 @@ const test = "💖"; =================...
Single line comments are merged on trailing trivia **Prettier 2.1.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEAHgBQCU+wAOlAL74D09+qOATgM4zUDcj+7cSFAAmIADQgIAB1zR2yUAENWrCAHcACsoTyUigDZrFAT3kSARq0VgA1nBgBlKdZxQA5shit0cCXAC25nDCwsEAMoru6IpucABiEKz+ijC47sggiugwEOIgABYw-voA6vk48OzOY...
@sosukesuzuki I tracked the issue to this piece of code: https://github.com/prettier/prettier/blob/74d144989659f0a03922f91c28d1f109cf12a14a/src/document/doc-printer.js#L468-L470 Happy to work on a fix and add tests, but since I'm a first time contributor, some pointers would be appreciated. Can you please let me ...
2022-09-06T22:25:15Z
3.0
[]
[ "tests/format/js/comments/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEAHgBQCU+wAOlAL74D09+qOATgM4zUDcj+7cSFAAmIADQgIAB1zR2yUAENWrCAHcACsoTyUigDZrFAT3kSARq0VgA1nBgBlKdZxQA5shit0cCXAC25nDCwsEAMoru6IpucABiEKz+ijC47sggiugwEOIgABYw-voA6vk48OzOYHAOOhU4AG4Vxhlg7GYgrgKsMBpWbsnIqAYCEgBW7IQAQla29g6K-nBhrnDDo74gk4QOrm76cACK6BDwG-pjI...
prettier/prettier
13,445
prettier__prettier-13445
[ "12653" ]
2dc687c613bb40872922bd111f43a8cbe0cee56f
diff --git a/.eslintrc.cjs b/.eslintrc.cjs --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -321,6 +321,7 @@ module.exports = { }, { files: ["src/language-js/**/*.js"], + excludedFiles: ["src/language-js/parse/postprocess/*.js"], rules: { "prettier-internal-rules/no-node-comments": [ ...
diff --git a/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/comments/__snapshots__/jsfmt.spec.js.snap @@ -3144,6 +3144,230 @@ function HelloWorld() { ============...
Nestled JSDoc comments are still broken after #9672 **Prettier 2.6.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAzCFMC8mAOiAEICGATqQNzFQMD0AVCw5i5gALwC2ABwA2FeJgAqHLtwHUKfTMHEBPAXAC+mGKrhSesqvMXjNANwpCArrqiceVODEtVbwAGoXr6qU1btb0gZGSjqa2mp63A5OLooeVho+DNiWUGAwAJbQmOYJABThcAA0OZ5wAJSKHJ...
2022-09-08T08:23:51Z
3.0
[]
[ "tests/format/js/comments/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAzCFMC8mAOiAEICGATqQNzFQMD0AVCw5i5gALwC2ABwA2FeJgAqHLtwHUKfTMHEBPAXAC+mGKrhSesqvMXjNANwpCArrqiceVODEtVbwAGoXr6qU1btb0gZGSjqa2mp63A5OLooeVho+DNiWUGAwAJbQmOYJABThcAA0OZ5wAJSKHJgZ2Jh51ADmlnwIMGgAdEIIjTAAFoQERABMlcDVmJjRzrZQcADumADC0GDRcPHWBToludbl9LaYmnBCaHBVR5P...
prettier/prettier
13,487
prettier__prettier-13487
[ "12889" ]
5107a55d6dbe6113505fabfab201acbae4055ebf
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -621,6 +621,7 @@ function genericPrint(path, options, print) { // Ignore escape `\` if ( + iNode.type !== "value-stri...
diff --git a/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap b/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,38 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP ...
SCSS: Prettier doesn't wrap multiline strings with escaped characters **Prettier 2.6.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEASAJnAzmATgSwAcZ9okACAHRABkJc4BbcorAV2fQgBt7yt8MKpWoBDRnBgjqAGnKQoWOGHgw2ucqPRF8OfFADm5ON0Fzq5ANSUo5KiCXpyXY-jZZGEJ-EaE++sHxtdDZYcjYhblEAI3o4YyEuXgZyRlEDKFFNUwBHN...
2022-09-17T20:40:32Z
3.0
[]
[ "tests/format/scss/quotes/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEASAJnAzmATgSwAcZ9okACAHRABkJc4BbcorAV2fQgBt7yt8MKpWoBDRnBgjqAGnKQoWOGHgw2ucqPRF8OfFADm5ON0Fzq5ANSUo5KiCXpyXY-jZZGEJ-EaE++sHxtdDZYcjYhblEAI3o4YyEuXgZyRlEDKFFNUwBHNlEAOmoAbhsQGRAIYlJFZFBRXFwIAHcABQaELGQQUW5m0QBPLoro3FEwAGtJAGVxOBp9OGQAM16lEbHJmcJx-QNkGFw2OAqmaLh0THQa...
prettier/prettier
13,608
prettier__prettier-13608
[ "13588" ]
f4f36b94ec1a0133005c736585002f5de8be938f
diff --git a/src/language-js/print/array.js b/src/language-js/print/array.js --- a/src/language-js/print/array.js +++ b/src/language-js/print/array.js @@ -23,6 +23,19 @@ import { printOptionalToken, printTypeAnnotation } from "./misc.js"; /** @typedef {import("../../document/builders.js").Doc} Doc */ +function pri...
diff --git a/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/tuple/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,203 @@ // Jest Snapshot v1, h...
Comment in empty array type breaks code **Prettier 2.7.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLWcBOAzAhmOAAgA1DgAdKQwgDyUIG1LrqB6V25wgXQG5KAviAA0ICAAcYqaAGdkoXJkwQA7gAVFCOSlwAbFbgCec0QCNM+ANZwYAZVwBbOABl0cZHl0y4Zi2Gt24vjoAObIMJgArj4gcA6mcAAmiUnOuFAhkbghcABiEJgOuDBSGcgguJEwECIgABYwDroA...
Related comment about refactoring of dangling comments: https://github.com/prettier/prettier/pull/13445#issuecomment-1240723341
2022-10-10T08:54:39Z
3.0
[]
[ "tests/format/typescript/tuple/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLWcBOAzAhmOAAgA1DgAdKQwgDyUIG1LrqB6V25wgXQG5KAviAA0ICAAcYqaAGdkoXJkwQA7gAVFCOSlwAbFbgCec0QCNM+ANZwYAZVwBbOABl0cZHl0y4Zi2Gt24vjoAObIMJgArj4gcA6mcAAmiUnOuFAhkbghcABiEJgOuDBSGcgguJEwECIgABYwDroA6nWo8DJBBLZa7agAbu2G5WAyJmhQ3pgwahYhRR563qIAVjI0tqG6cACKkRDwi14xQZhT5TCG4...
prettier/prettier
13,621
prettier__prettier-13621
[ "13620" ]
6d6e5177dbb9746e55706f4bece8666df578aceb
diff --git a/src/language-js/print/template-literal.js b/src/language-js/print/template-literal.js --- a/src/language-js/print/template-literal.js +++ b/src/language-js/print/template-literal.js @@ -50,6 +50,7 @@ function printTemplateLiteral(path, print, options) { parts.push(lineSuffixBoundary, "`"); + let pr...
diff --git a/tests/format/js/template-literals/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/template-literals/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/template-literals/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/template-literals/__snapshots__/jsfmt.spec.js.snap @@ -231,6 +231,190 @@ thr...
Strange indention in template literal **Prettier 2.7.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEADAOlABDrBGAOiwHEIsYz0QBaagQ2qqwBJhNdcwALOgGwGsCAcwBOcBAQCuUACZwRvAJZQ4ACipcYMAA4BnJAHoDAd1MEo2gLYArXQUiWD2umH50hcJ2K2L5Bl2BwurpUAJTsuAC+ETgATESk5JQgrHTRICxs2BxY3HyCouJQUrLySirqIJo6+kamxuZWtvYQj...
Looking at the output doc, change it to ```diff + dedentToRoot(align(0,indent(indent( group([ "chalk", ".", "green", ".", "underline", group([ "(", indent([softline, '"https://www.npmjs.com/package/prettier/access"']), ifBreak(""), ...
2022-10-12T11:12:03Z
3.0
[]
[ "tests/format/js/template-literals/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEADAOlABDrBGAOiwHEIsYz0QBaagQ2qqwBJhNdcwALOgGwGsCAcwBOcBAQCuUACZwRvAJZQ4ACipcYMAA4BnJAHoDAd1MEo2gLYArXQUiWD2umH50hcJ2K2L5Bl2BwurpUAJTsuAC+ETgATESk5JQgrHTRICxs2BxY3HyCouJQUrLySirqIJo6+kamxuZWtvYQjs6u7p7a3jC+Iv5ggcFhMVjRUKggADQgENq90LrIoHQiIhDGAAqrCEsofMZ0AJ5LMwBGIi78...
prettier/prettier
13,877
prettier__prettier-13877
[ "9760" ]
c4f1a670d9c47144cc19c1d9ea91950abe1cf293
diff --git a/src/language-js/parse/babel.js b/src/language-js/parse/babel.js --- a/src/language-js/parse/babel.js +++ b/src/language-js/parse/babel.js @@ -207,8 +207,6 @@ const allowedMessageCodes = new Set([ "InvalidTupleMemberLabel", "NonClassMethodPropertyHasAbstractModifer", - "ClassMethodHasDeclare", - "...
diff --git a/tests/format/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,7 @@ ...
Missing `readonly` and `declare` in `ClassMethod` and `TSMethodSignature` **Prettier 2.2.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgMI7AA6UOOATnOgCbSoCeOAVHABQCUhAviWdXGAyVmAMw7cSPKCQCWsOORHowcHADEIEQrxz9B6YW3YBuHegBGmGOWUwcYk5JAAaEBAAOMGdEzJQB8ggAdwAFAwRfFHRUIPR6X1dzGzAAazgYAGV3...
> [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgMI7AA6UOOATnOgCbSoCeOAVHABQCUhAviWdXGAyVmAMw7cSXEABoQEAA4wAltEzJQ6cuQgB3AAqaEalOlQ709NbIBG5dGADWcGAGV59pVADmyGOQCucLJwALbWcNT81AAy6N7+6F5wAGIQ5CHoMMreyCDo-jAQMiAAFjAhqADqJUrwmO5gcC5GtUoAbrX0uWDYxZ6YcOQwenZeGcgipgOyAFaYAB4AQnaOzi7oIXDRnnATU0...
2022-11-21T09:21:29Z
3.0
[ "tests/format/misc/errors/typescript/babel-ts/jsfmt.spec.js", "tests/format/typescript/keywords/jsfmt.spec.js", "tests/format/misc/typescript-only/jsfmt.spec.js", "tests/format/misc/typescript-babel-only/jsfmt.spec.js" ]
[ "tests/format/misc/errors/typescript/modifiers/jsfmt.spec.js", "tests/format/misc/errors/typescript/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgMI7AA6UOOATnOgCbSoCeOAVHABQCUhAviWdXGAyVmAMw7cSPKCQCWsOORHowcHADEIEQrxz9B6YW3YBuHegBGmGOWUwcYk5JAAaEBAAOMGdEzJQB8ggAdwAFAwRfFHRUIPR6X1dzGzAAazgYAGV3ZTkAc2RrAFc4VzgAW3M4an5qABl0KFzC9Fy4DXIy9BgvRuQQdEKYCBcQAAsYMtQAdVGZeExslQyIuZkANzn6PrBsEblMBRgQm1zO5CVUA9c...
prettier/prettier
14,007
prettier__prettier-14007
[ "11483" ]
b50dfd1974d33abb980e9b4df949913932eeb478
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -101,7 +101,10 @@ function genericPrint(path, options, print) { return [node.raw, hardline]; case "css-root": { const nodes = p...
diff --git a/tests/format/less/less/__snapshots__/jsfmt.spec.js.snap b/tests/format/less/less/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/less/less/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/less/less/__snapshots__/jsfmt.spec.js.snap @@ -83,6 +83,24 @@ a: b; ===========================================...
Prettier infinitely suggests additional " ;" to the end of less detached rulesets **Prettier 2.3.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEABAbgQwE4EtMBGANnEgATAA6UZZAZrnEQCbkDOEAtnDABa5QA5tQC+AbhAAaEBAAOMXNDbJQObBADuABRwJlKTEQ2YAnsukFsmMAGseAZUzcAMgLjI6htnAtXbD2WsBQWQYbABXHxA4TgI4ZmZ450w...
the problem is only with the last LESS ruleset: https://prettier.io/playground/#N4Igxg9gdgLgprEAuEABAHkgBMAOlAXwG58Ns9CSoyd9j8QAaECABxgEtoBnZUAQwBOgiAHcACkIS8U-ADaj+AT17MARoP5gA1nBgBlfgFs4AGQ5Q4yAGbzucdZp179rLRYDmyGIICuDkDgjNTgAE1Cw034oD19+DzgAMQhBI34YThjkEH5fGAgmEAALGCM5AHUijnhuNzA4fWlqjgA3aqVssG5VEAt7QRhxTQ80mzsAgCtu...
2022-12-17T13:37:26Z
2.9
[]
[ "tests/format/less/less/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEABAbgQwE4EtMBGANnEgATAA6UZZAZrnEQCbkDOEAtnDABa5QA5tQC+AbhAAaEBAAOMXNDbJQObBADuABRwJlKTEQ2YAnsukFsmMAGseAZUzcAMgLjI6htnAtXbD2WsBQWQYbABXHxA4TgI4ZmZ450whcMxBOAAxCGxOTBgFIWQQTHCYCCkQXhhOIgB1fng2QLA4ez1cBXROk2KwNnMQAW9sGC0rQTyPLyiAKzYAD3tgkgBFcIh4aaJvaUDsEeKSAcrZPFg63G...
prettier/prettier
14,008
prettier__prettier-14008
[ "13998" ]
b50dfd1974d33abb980e9b4df949913932eeb478
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -744,6 +744,18 @@ function genericPrint(path, options, print) { continue; } + // No space before unary minus followed...
diff --git a/tests/format/less/parens/__snapshots__/jsfmt.spec.js.snap b/tests/format/less/parens/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/less/parens/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/less/parens/__snapshots__/jsfmt.spec.js.snap @@ -302,6 +302,23 @@ a { unicode-range: U+0025-00FF, U+4...
Unary minus must not be followed by a space in LESS Current version of Prettier is adding a space after unary minus operator in LESS. Config: ``` module.exports = { tabWidth: 4, overrides: [ { files: ['*.less'], options: { parser: 'less', }...
minimal playground repro link: https://prettier.io/playground/#N4Igxg9gdgLgprEAuEACAdAD264AdKVI1AWwEMAnAcwEsolUAGVAWgAoABSiiAdwCEIFACZwKAdRrCYAC1QB6VACYAlEyYBuAqgC+IADQgIABxg1oAZ2ShufAAqUEVlGQA2vMgE8rhgEYUyMABrOBgAZTISOAAZOjhkADM3Czg-AODQsONAuipkGAoAV1SQOBJfOGFRYWiyKCpCsio4ADEhchgzeuQQMkKYCAMQGRgSV3EZGngLbLA4MKcpmgA3Kc...
2022-12-17T15:59:49Z
2.9
[]
[ "tests/format/scss/parens/jsfmt.spec.js", "tests/format/less/parens/jsfmt.spec.js" ]
JavaScript
[]
[]
prettier/prettier
14,038
prettier__prettier-14038
[ "14036" ]
985b895c47d1b9da25cde0c0b56376606b9c1559
diff --git a/src/language-js/comments.js b/src/language-js/comments.js --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -453,6 +453,9 @@ const propertyLikeNodeTypes = new Set([ "TSAbstractMethodDefinition", "TSDeclareMethod", "MethodDefinition", + "ClassAccessorProperty", + "AccessorPro...
diff --git a/tests/config/format-test.js b/tests/config/format-test.js --- a/tests/config/format-test.js +++ b/tests/config/format-test.js @@ -72,6 +72,7 @@ const meriyahDisabledTests = new Set([ "static.js", "with-semicolon-1.js", "with-semicolon-2.js", + "comments.js", ].map((filename) => pa...
Incorrect formatting for auto-accessors with comments <!-- BEFORE SUBMITTING AN ISSUE: 1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experiencing,...
This is actually bug in TypeScript https://github.com/microsoft/TypeScript/issues/51707 But I think here the issue has nothing todo with that bug in TypeScript. My input is `accessor b` with no line terminators. The prettier formatted that into separated lines, which according to the spec draft, is not matching with...
2022-12-19T10:39:42Z
2.9
[]
[ "tests/format/js/decorator-auto-accessors/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgII7AA6UOOAAgCZxgAUAlCWQPTM5yaoCWsAtJV0zoARqji8ocAB4xe3SRRgBPAA4cwAJy4rZHeTGbD0UXjEy9IAW0sIYTHK0XmuAcygQNce+jBgOmDxxhAG4SAF8QABoQCB0uaExkUHQNDQgAdwAFFIRElHRUdPQlROjhDR8AazgYAGV0GwAZHjhkADMCzDgyirBqupUfHhdkGA0AV26QOEthOEpqSkbjF3H0FzgAMQ9LdBgYYeQQdHGYCCiQAAs...
prettier/prettier
14,044
prettier__prettier-14044
[ "10828" ]
20fad630fab9f62ad37220ffdc7fbff1faf0f2af
diff --git a/src/language-js/needs-parens.js b/src/language-js/needs-parens.js --- a/src/language-js/needs-parens.js +++ b/src/language-js/needs-parens.js @@ -67,16 +67,32 @@ function needsParens(path, options) { return true; } - // `for (async of []);` is invalid + // `for ((async) of []);` and `fo...
diff --git a/tests/format/js/identifier/for-of/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/identifier/for-of/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/js/identifier/for-of/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + ...
Missing parentheses `for ((let) of []);` **Prettier 2.2.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzCAnABAChwGzhgEosJUsBtAXWIG4QAaECABxgEtoBnZUAQwwYIAdwAKghLxT98I-gE9ezAEYZ+YANZEAyqw0coAc2QwMAVzjM4AWxVwAJg8cAZfsfP8jcAGKYb-DCcxsgg-OYwEEwgABYwNvgA6jEc8Nz6YHA6UqkcAG6pCqFg3MoghtxwGDBi6kYByKiy...
## summary according to spec **for in:** ```js for (expression1 in expression2) {} ``` If `expressin1` starts with `let[`, it should be wrapped by parens. **for of:** ```js for (expression1 of expression2) {} ``` If `expression1` starts with `let` or `async of`, it should be wrapped by parens. ...
2022-12-22T02:17:04Z
2.9
[]
[ "tests/format/js/identifier/for-of/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzCAnABAChwGzhgEosJUsBtAXWIG4QAaECABxgEtoBnZUAQwwYIAdwAKghLxT98I-gE9ezAEYZ+YANZEAyqw0coAc2QwMAVzjM4AWxVwAJg8cAZfsfP8jcAGKYb-DCcxsgg-OYwEEwgABYwNvgA6jEc8Nz6YHA6UqkcAG6pCqFg3MoghtxwGDBi6kYByKiylcwAVtwAHgBC6lq6-DZwLoZwjc1WIO0dOoZGhACK5hDwY-gtIPoYlRihKvz2+NGsGIYwiRwOMD...
prettier/prettier
14,073
prettier__prettier-14073
[ "13817" ]
948b3af232d9be1cf973a143382cad3ebe33725a
diff --git a/src/language-js/print/type-parameters.js b/src/language-js/print/type-parameters.js --- a/src/language-js/print/type-parameters.js +++ b/src/language-js/print/type-parameters.js @@ -44,12 +44,12 @@ function printTypeParameters(path, options, print, paramsKey) { ); const shouldInline = - !isArrow...
diff --git a/tests/format/typescript/typeparams/empty-parameters-with-arrow-function/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/typeparams/empty-parameters-with-arrow-function/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/typescript/typeparams/empty-parameters-wi...
[flow] broken code emitted for type annotation with empty type parameters when the value is an arrow function and `arrow-parens: 'avoid'` **Prettier 2.7.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAPXf8GFHGFI4kW4A8AfJgLwA6UmmAhgE4DmDdUArgBtBAbhAAaEBAAOMAJbpkoThwgB3AAqcEaZCDYA3CHIAmEkA...
It's worth noting that the same code emits correctly [for `typescript`](https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAPXf8GFHGFI4kW4A8AfJgLwA6UmmAhgE4DmDdUArgBtBAbhAAaEBAAOMAJbpkoThwgB3AAqcEaZCDYA3CHIAmEkACMObMAGs4MAMpsAtnAAycqHGQAzNoJocJJWNvZO0jZeXMgwHPzBIHAuFnAmJmnubFBc-GxccABiEBwubDDyOXps-DAQ5gAWMC6CAOoNc...
2022-12-28T11:59:30Z
2.9
[]
[ "tests/format/typescript/typeparams/empty-parameters-with-arrow-function/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEAPXf8GFHGFI4kW4A8AfJgLwA6UmmAhgE4DmDdUArgBtBAbhAAaEBAAOMAJbpkoThwgB3AAqcEaZCDYA3CHIAmEkACMObMAGs4MAMpsAtnAAycqHGQAzNoJocJJWNvZO0jZeXMgwHPzBIHAuFnAmJmnubFBc-GxccABiEBwubDDyOXps-DAQ5gAWMC6CAOoNcvBokWBwjjqdcgadAJ56YGi6kl5BHDAa1lxlfgFBkgBWaNiO0YJwAIr8EPArgYmRHLN6...
prettier/prettier
14,081
prettier__prettier-14081
[ "14080" ]
ef707da0a2cafa56b46a94b865069a3cf401835d
diff --git a/src/language-js/print/literal.js b/src/language-js/print/literal.js --- a/src/language-js/print/literal.js +++ b/src/language-js/print/literal.js @@ -1,6 +1,7 @@ "use strict"; const { printString, printNumber } = require("../../common/util.js"); const { replaceTextEndOfLine } = require("../../document/d...
diff --git a/tests/format/js/directives/comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/directives/comments/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/js/directives/comments/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,569 @@ +// Jest Snapshot v1, https://goo.gl/fb...
Can't print comment after directive **Prettier 2.8.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEByArgZzgAkzAJwEswZUBuAHSmoHoAqHSAW2YRh3tuoG0BdAHQAzCAQCiAQzAALABQBKciAA0ICAAcYRaJmSgJBAhADuABQMJdKCQBtjEgJ67VAIwJSA1nBgBlCWwAZIig4ZCFbbFd3MC9fdSlggHNkQnQ4VThmFzgAExzcgIkoRPQJRLgAMVFmCRgtYuQQCXQYCB...
2022-12-29T10:43:25Z
2.9
[]
[ "tests/format/js/directives/comments/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEByArgZzgAkzAJwEswZUBuAHSmoHoAqHSAW2YRh3tuoG0BdAHQAzCAQCiAQzAALABQBKciAA0ICAAcYRaJmSgJBAhADuABQMJdKCQBtjEgJ67VAIwJSA1nBgBlCWwAZIig4ZCFbbFd3MC9fdSlggHNkQnQ4VThmFzgAExzcgIkoRPQJRLgAMVFmCRgtYuQQCXQYCBUQaRhmGwB1aSJ4THiwOB9LAaIANwGHRrBMZxBg7AIYU3dEmrCI9JAAK0wADx8kmzgARXQ...
prettier/prettier
14,082
prettier__prettier-14082
[ "11242" ]
ef707da0a2cafa56b46a94b865069a3cf401835d
diff --git a/src/language-js/print/jsx.js b/src/language-js/print/jsx.js --- a/src/language-js/print/jsx.js +++ b/src/language-js/print/jsx.js @@ -3,6 +3,7 @@ const { printComments, printDanglingComments, + printCommentsSeparately, } = require("../../main/comments.js"); const { builders: { @@ -490,7 +491,1...
diff --git a/tests/config/format-test.js b/tests/config/format-test.js --- a/tests/config/format-test.js +++ b/tests/config/format-test.js @@ -42,6 +42,7 @@ const unstableTests = new Map( "js/for/continue-and-break-comment-without-blocks.js", "typescript/satisfies-operators/comments-unstable.ts", ["js/id...
Using inline comments (/* */) before an element attribute's value in JSX causes document to not be formatted **Prettier 2.3.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEAsgJ4Bim2eUAwhALYAO0CMAFAJT7AA6U3MAHgBG6GDAIAbAIZC4EgLwB6AFRxli7iDiaAfCLHQBi-eKg7eAXxAAaEBAa5oAZ2SgpAJ3cQA7gAUP...
Workaround **Prettier 2.3.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEAsgJ4Bim2eUAwhALYAO0CMAFAJT7AA6U3MAHgBG6GDAIAbAIZC4EgLwB6AFRxliniDjcQAXwB8IsdAGKj4qPt66QAGhAQGuaAGdkoKQCdPEAO4AFLwQ3FCkJXyliN3shTykwAGs4GABlBnicKABzZBhPdDh7ODpZABNSuFKAGSls9CksuFIITzopMUyc0NEIOxAACxg6CQB1fpx4...
2022-12-29T11:07:25Z
2.9
[]
[ "tests/format/jsx/comments/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEAsgJ4Bim2eUAwhALYAO0CMAFAJT7AA6U3MAHgBG6GDAIAbAIZC4EgLwB6AFRxli7iDiaAfCLHQBi-eKg7eAXxAAaEBAa5oAZ2SgpAJ3cQA7gAUPCC4oUhLeUsQutkLuUmAA1nAwAMoMsThQAObIMO7ocLZwdLIAJsVwxQAyUpnoUhlwpBDudFJi6VnBohA2IAAWMHQSAOq9OPBOqWBwSYFjOABuY8TI4E6RIOlOcO4wvjEZLcioIVu2AFZOAB...
prettier/prettier
14,085
prettier__prettier-14085
[ "3722", "6198" ]
be84156d43805a281369c934ae28148065d6316e
diff --git a/src/language-js/print/type-parameters.js b/src/language-js/print/type-parameters.js --- a/src/language-js/print/type-parameters.js +++ b/src/language-js/print/type-parameters.js @@ -79,7 +79,7 @@ function printTypeParameters(path, options, print, paramsKey) { !node[paramsKey][0].constraint && ...
diff --git a/tests/format/flow/function-parentheses/__snapshots__/jsfmt.spec.js.snap b/tests/format/flow/function-parentheses/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/flow/function-parentheses/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/flow/function-parentheses/__snapshots__/jsfmt.spec.js.snap @@ -6...
Trailing commas for type parameters in Flow with --trailing-comma=es5 I'm not sure if this is the correct behavior or not, but I just moved from `trailingComma: "all"` to `trailingComma: "es5"` in our codebase at work, and was surprised to see these ones disappear. **Prettier 1.9.2** [Playground link](https://prett...
Related: https://github.com/prettier/prettier/issues/3662 https://github.com/prettier/prettier/pull/3313 Following that logic we could consider that `"es5" == "all"` since it's valid in TS anyway, not ES :joy: Yeah I guess that's kinda weird... I'm looking at it from the flow perspective, though. @suchipi looks like a...
2022-12-30T09:14:16Z
3.0
[ "tests/format/typescript/typeparams/trailing-comma/jsfmt.spec.js", "tests/format/typescript/interface2/break/jsfmt.spec.js", "tests/format/typescript/interface2/jsfmt.spec.js" ]
[ "tests/format/typescript/trailing-comma/jsfmt.spec.js", "tests/format/flow/type-parameters/trailing-comma/jsfmt.spec.js", "tests/format/flow/interface-types/break/jsfmt.spec.js", "tests/format/flow/function-parentheses/jsfmt.spec.js", "tests/format/flow/generic/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEMCeAHOACAYhCAFQAsBLAZwDkBDAWzgElyA1OAJzQBloBzAZSLFqMBjABCbONQDW5QoLiU4ADxidSUHAF5sA+jDJQeAHlyk25GAAVqbOgBpdcSFAAmNu7QB8AbhD2QCAwYUmhyZFBbNggAdw8EcJRqADcIUld-EGpLZBg2AFc4AIAjOzBpOBg+DGowDR5cgqKQVwgwZAAzagAbcmaNPrZrOx5aak6evoCAK3JlCVqKqro4dU0J3uaIfJgMHYAmDamQGot2ZBBi...
prettier/prettier
14,089
prettier__prettier-14089
[ "14088", "13995" ]
b77d912c0c1a5df85e3e9b5b192fc92523e411ee
diff --git a/src/language-css/parser-postcss.js b/src/language-css/parser-postcss.js --- a/src/language-css/parser-postcss.js +++ b/src/language-css/parser-postcss.js @@ -122,23 +122,6 @@ function parseValueNode(valueNode, options) { parenGroupStack.pop(); parenGroup = getLast(parenGroupStack); } els...
diff --git a/tests/format/scss/map/function-argument/__snapshots__/jsfmt.spec.js.snap b/tests/format/scss/map/function-argument/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/scss/map/function-argument/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/scss/map/function-argument/__snapshots__/jsfmt.spec.js.snap @...
Idempotent issue for SCSS map **Prettier 2.8.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEASAJgSwM4AcA2AhgJ4C0ARgE5yEDWuEms2SABALaG6npxzfs4lAOZwAFAB0orVpOkzWEkAA9spaPmJK2SjcVbYw1BK0JR0szstIB3TOhgALNgGJgnbqJhjUwyvYpqOgYmGGwAGkUQbHYlAEpSAEYAXzilcKkZOIz5DBwCEkCaekZmKTiAbhBwkAhcGExobGRQQkpKCBsAB...
2022-12-30T14:45:59Z
2.9
[]
[ "tests/format/scss/map/function-argument/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground-redirect", "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEASAJgSwM4AcA2AhgJ4C0ARgE5yEDWuEms2SABALaG6npxzfs4lAOZwAFAB0orVpOkzWEkAA9spaPmJK2SjcVbYw1BK0JR0szstIB3TOhgALNgGJgnbqJhjUwyvYpqOgYmGGwAGkUQbHYlAEpSAEYAXzilcKkZOIz5DBwCEkCaekZmKTiAbhBwkAhcGExobGRQQkpKCBsABTaEZpRCfBsSZpqqQjB...
prettier/prettier
14,109
prettier__prettier-14109
[ "11340" ]
2f72344944384d28c6d00523febf03f294108e2c
diff --git a/src/language-css/parser-postcss.js b/src/language-css/parser-postcss.js --- a/src/language-css/parser-postcss.js +++ b/src/language-css/parser-postcss.js @@ -220,6 +220,11 @@ async function parseNestedValue(node, options) { } async function parseValue(value, options) { + // Inline javascript in Less +...
diff --git a/tests/format/less/inline-javascript/__snapshots__/jsfmt.spec.js.snap b/tests/format/less/inline-javascript/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/less/inline-javascript/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbA...
less format problem **Prettier 2.3.2** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEA6MBDANmACgDwFkBLfYqACgEoACYAHShpoAEAzAVyjBmOgGckNAH4ADCp269o1Oo2bNIUfjBoATOP2IBzKAHViamAAsaAXhoBmABwAWAAzyFSlTQw8O2A0dMWArADsAGyOTAomxPzo2Hj45jSSPHyUAPq0DGEKNABOcDAc2UwpNABUbh5ehiY0APTqmjr6VaYA1DQA5AAO+O1OzAC+Tv...
The next branch seems fixed the parse error, but not formatting as JavaScript code. **Prettier pr-9583** [Playground link](https://deploy-preview-9583--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEA6MBDANmACgDwFkBLfYqACgEoACYAHShpoAEAzAVyjBmOgGckNAH4ADCp269o1Oo2bNIUfjBoATOP2IBzKAHViamAAsaAXhoBmABwAWAAzyFSlTQw...
2023-01-04T09:46:00Z
3.0
[]
[ "tests/format/less/inline-javascript/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEA6MBDANmACgDwFkBLfYqACgEoACYAHShpoAEAzAVyjBmOgGckNAH4ADCp269o1Oo2bNIUfjBoATOP2IBzKAHViamAAsaAXhoBmABwAWAAzyFSlTQw8O2A0dMWArADsAGyOTAomxPzo2Hj45jSSPHyUAPq0DGEKNABOcDAc2UwpNABUbh5ehiY0APTqmjr6VaYA1DQA5AAO+O1OzAC+Tv1U1KKM-SAANCAQndLKyKAY2dkQAO64ywj8yCDYaxgAnjvTAEbZ7gD...
prettier/prettier
14,163
prettier__prettier-14163
[ "13986" ]
d0eb185980a7909cf00667218a6e4bb5450f16da
diff --git a/src/language-js/print/jsx.js b/src/language-js/print/jsx.js --- a/src/language-js/print/jsx.js +++ b/src/language-js/print/jsx.js @@ -13,6 +13,7 @@ import { ifBreak, lineSuffixBoundary, join, + cursor, } from "../../document/builders.js"; import { willBreak, replaceEndOfLine } from "../../docum...
diff --git a/tests/format/jsx/cursor/__snapshots__/jsfmt.spec.js.snap b/tests/format/jsx/cursor/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/jsx/cursor/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,20 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`in-jsx-text.js forma...
Wrong cursorOffset with formatted JSX text In a similar vein to #12491 (which I am still intending to fix), I found a misplaced cursorOffset issue with code like this ```jsx <>a• <div>hi</div> </> ``` (where `•` denotes the given cursor position) When passed into prettier we get: ```jsx <>• a<div>hi</...
2023-01-12T10:15:59Z
3.0
[]
[ "tests/format/jsx/cursor/jsfmt.spec.js" ]
JavaScript
[]
[]
prettier/prettier
14,170
prettier__prettier-14170
[ "14168" ]
c1b976572c7512dfa7d7407706891f511883c0ad
diff --git a/src/language-html/parser-html.js b/src/language-html/parser-html.js --- a/src/language-html/parser-html.js +++ b/src/language-html/parser-html.js @@ -24,7 +24,7 @@ const { locStart, locEnd } = require("./loc.js"); * @typedef {import('angular-html-parser/lib/compiler/src/ml_parser/parser').ParseTreeResult...
diff --git a/tests/format/angular/self-closing/__snapshots__/jsfmt.spec.js.snap b/tests/format/angular/self-closing/__snapshots__/jsfmt.spec.js.snap new file mode 100644 --- /dev/null +++ b/tests/format/angular/self-closing/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,36 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + ...
Angular templates self closing tags <!-- BEFORE SUBMITTING AN ISSUE: 1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experiencing, you do not n...
2023-01-13T02:01:08Z
2.9
[]
[ "tests/format/angular/self-closing/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground", "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAeAhgB0wWngZxgHoA+AHShABoQJMYBLafZUdAJ3YgHcAFDhCxToANt3QBPFjQBG7dGADWcGAGV0AWzgAZBlDjIAZqPxxZ8pStWYFegObIY7AK5mQcDTLgATbz+3oUHbO6HZwAGIQ7BroMIxByCDozjAQ1CAAFjAaIgDqGQwENmBwqoKFDABuhRKJYPjSIHqm7DC88nYxRiZuAFb4AB6q9iJwAIrOEPDdIqY0N...
prettier/prettier
14,192
prettier__prettier-14192
[ "13980" ]
9e855021075af184f2183114c7651d47b209f019
diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -29,6 +29,7 @@ import { markerForIfWithoutBlockAndSameLineComment, isArrayOrTupleExpression, isObjectOrRecordExpression, + startsWithNoLookahead...
diff --git a/tests/format/js/async/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/async/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/async/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/async/__snapshots__/jsfmt.spec.js.snap @@ -198,6 +198,31 @@ const getAccountCount = async () => ===============...
Unnecessary whitespace around `await` in multi-line chain passed to a function **Prettier 2.8.1** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLAtgBwgJxgAmHxzgEMATc1HfAX3wDMcJ18AdEBgZwHpNn0qLnC4cA3GyiTSAd1KoCABQFC4AOlIAbTQApJ+fDtnyCJClRx6QXHGA4BKe2vSlMRrgE8oYQ5lIwAC3t8AF4APkJ9A3wMbDwdAAM1HgASYD...
2023-01-16T20:24:27Z
3.0
[]
[ "tests/format/js/async/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLAtgBwgJxgAmHxzgEMATc1HfAX3wDMcJ18AdEBgZwHpNn0qLnC4cA3GyiTSAd1KoCABQFC4AOlIAbTQApJ+fDtnyCJClRx6QXHGA4BKe2vSlMRrgE8oYQ5lIwAC3t8AF4APkJ9A3wMbDwdAAM1HgASYD9A2gT7CSgDWntJHMkQABoQCEwYVGguZFBSHGYZRUaEOpQtOQ868oAjHFIwAGs4GABlUnQ4ABlUKDhkBi1hfsGRsfG-MHmAc2QYHABXOHK4dD64Si...
prettier/prettier
14,208
prettier__prettier-14208
[ "6024", "13260" ]
cf409fe6a458d080ed7f673a7347e00ec3c0b405
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -1,5 +1,7 @@ "use strict"; +/** @typedef {import("../document").Doc} Doc */ + const getLast = require("../utils/get-last.js"); const { pri...
diff --git a/tests/format/css/atrule/__snapshots__/jsfmt.spec.js.snap b/tests/format/css/atrule/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/css/atrule/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/css/atrule/__snapshots__/jsfmt.spec.js.snap @@ -1580,33 +1580,39 @@ format( ================================...
When box-shadow has multiple values (separated by comma) it'd be prettier to put each value on a separate line **Prettier 1.16.4** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAjCAPAtAZwBYCGAJhAO5IA6UABNQAwAOG1AjE-RwMQBmvANFVqNmAJnZ0ucKQG4qIPiAgMYAS2g5koAgCdtZAAo6EGlAQBuEFUXlptBMAGs4MAMoN7KqAHNk...
I would love something like this! I agree with this. `box-shadow` with multiple values looks better with each value on a separate line. How about other properties like `background`, `background-image`, `text-shadow`, `@font-face#src`? **background-image** (from [Lea Verou Patterns](http://projects.verou.me/css3...
2023-01-20T13:00:08Z
2.9
[]
[ "tests/format/scss/scss/jsfmt.spec.js", "tests/format/scss/comments/jsfmt.spec.js", "tests/format/less/less/jsfmt.spec.js", "tests/format/less/comments/jsfmt.spec.js", "tests/format/css/fill-value/jsfmt.spec.js", "tests/format/css/indent/jsfmt.spec.js", "tests/format/css/atrule/jsfmt.spec.js", "tests/...
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAjCAPAtAZwBYCGAJhAO5IA6UABNQAwAOG1AjE-RwMQBmvANFVqNmAJnZ0ucKQG4qIPiAgMYAS2g5koAgCdtZAAo6EGlAQBuEFUXlptBMAGs4MAMoN7KqAHNkMbQFc4BTwYAFsAGwB1PBV4HHcwOBdjWJUzWIBPZHAcDQVPHDhtGH07L1CCZG4CcMKFACscDAAhO0dnFwJQuAAZTzgqmrqQRowXTy9wuABFfwh4QdqgkHdtQu1ssFybBm1PGEirGDxkAA46BV2...
prettier/prettier
14,262
prettier__prettier-14262
[ "14227" ]
37fb53acf33a20379a93bfecea8242c03ce0a4fc
diff --git a/src/language-js/comments.js b/src/language-js/comments.js --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -31,6 +31,7 @@ const { } = require("./utils/index.js"); const { locStart, locEnd } = require("./loc.js"); const isBlockComment = require("./utils/is-block-comment.js"); +const...
diff --git a/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap --- a/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.j...
Allow parentheses when JSDoc to allow intellisense **Prettier 2.8.3** [Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBbCATArgGzgOjgA8AHCAJxgGcACAXhoHoAqZmgASoEMYBLKgGa84tYACU4kchgA8VGOV5QA5gBoa8xSoB8AXxrNGNABTAAOlBo0AFnBw4ISGgEYAzK4Dsqi7oCUAbhBVEAgSPmgqZFAucnIIAHcABRiESJQuHHiuAE9I4IAjci4wAGs4GABlL...
It becomes more and more popular to include JSDoc for configs etc. It really improves developer experience to not have to jump into documentation pages for property names and also prevents typos. Here is for instance Next.js official documentation. https://nextjs.org/docs/api-reference/next.config.js/introduction ...
2023-01-30T04:28:40Z
2.9
[]
[ "tests/format/js/comments-closure-typecast/jsfmt.spec.js" ]
JavaScript
[]
[ "https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBbCATArgGzgOjgA8AHCAJxgGcACAXhoHoAqZmgASoEMYBLKgGa84tYACU4kchgA8VGOV5QA5gBoa8xSoB8AXxrNGNABTAAOlBo0AFnBw4ISGgEYAzK4Dsqi7oCUAbhBVEAgSPmgqZFAucnIIAHcABRiESJQuHHiuAE9I4IAjci4wAGs4GABlLlQ4ABklOGQBDKo4AqLS8oqSYqVlZAUsNpA4VHy4DAwJ2q4VLC5lOAAxClQePhVkEC4sGAggkGsYVBwAdWtee...